from Spotfire.Dxp.Data import DataPropertyClass
from Spotfire.Dxp.Application.Visuals import BarChart
from Spotfire.Dxp.Application.Visuals.ConditionalColoring import Coloring
vc=vis.As[BarChart]()
if Document.Properties["SelectType"]=="All":
if Document.Properties["AccountName"] == "Exclude Zeros":
vc.Data.WhereClauseExpression="case when '${SelectType}'='Taxable Income' then ([Total Taxable Income])<>0 when '${SelectType}'='Component Income' and [Group]='O' then ([Value]) <>0 when '${SelectType}'='All' then ([Value]) <>0 end and ([Category] in ($map(\"\'${Components}\'\", \",\")) or [Category] in (\"Taxable Income\"))"
vc.YAxis.Expression="sum(Value)"
vc.ColorAxis.Expression="<[CategoryTest] as []>"
vc.ColorAxis.Coloring.Apply("Color Scheme")
else:
vc.YAxis.Expression="sum(Value)"
vc.ColorAxis.Expression="<[CategoryTest] as []>"
vc.Data.WhereClauseExpression="[Category] in ($map(\"\'${Components}\'\", \",\")) or [Category] in (\"Taxable Income\")"
vc.ColorAxis.Coloring.Apply("Color Scheme")
elif Document.Properties["SelectType"]=="Taxable Income":
vc.YAxis.Expression="sum([Total Taxable Income]) as [Taxable Income]"
vc.ColorAxis.Expression="<[Axis.Default.Names] as []>"
vc.ColorAxis.Coloring.Apply("Color Scheme")
#vc.Data.WhereClauseExpression=""
elif Document.Properties["SelectType"]=="Component Income":
vc.YAxis.Expression="${SelectComponents}"
vc.ColorAxis.Expression="<[Axis.Default.Names] as []>"
vc.ColorAxis.Coloring.Apply("Color Scheme")
#vc.Data.WhereClauseExpression=""
#Cross Table
from Spotfire.Dxp.Application.Visuals import VisualContent
vc1 = viz.As[VisualContent]()
if Document.Properties["SelectType"]=="All":
vc1.MeasureAxis.Expression="${SelectComponents},Sum([Taxable Income]) as [Taxable Income] "
if Document.Properties["AccountName"] == "Exclude Zeros":
vc1.Data.WhereClauseExpression='case when "${SelectType}"="All" then ([Taxable Income]) <>0 OR ($map("([${Components}])", "<>0 Or")<>0 ) end'
else:
vc1.Data.WhereClauseExpression=''
elif Document.Properties["SelectType"]=="Taxable Income":
vc1.MeasureAxis.Expression="Sum([Taxable Income]) as [Taxable Income]"
if Document.Properties["AccountName"] == "Exclude Zeros":
vc1.Data.WhereClauseExpression='case when "${SelectType}"="Taxable Income" then ([Taxable Income]) <>0 when "${SelectType}"="Component Income" then ($map("([${Components}])", "<>0 Or")<>0 ) end'
else:
vc1.Data.WhereClauseExpression=""
elif Document.Properties["SelectType"]=="Component Income":
vc1.MeasureAxis.Expression="${SelectComponents}"
if Document.Properties["AccountName"] == "Exclude Zeros":
vc1.Data.WhereClauseExpression='case when "${SelectType}"="Taxable Income" then ([Taxable Income]) <>0 when "${SelectType}"="Component Income" then ($map("([${Components}])", "<>0 Or")<>0 ) end'
else:
vc1.Data.WhereClauseExpression=''
from Spotfire.Dxp.Application.Visuals import BarChart
from Spotfire.Dxp.Application.Visuals.ConditionalColoring import Coloring
vc=vis.As[BarChart]()
if Document.Properties["SelectType"]=="All":
if Document.Properties["AccountName"] == "Exclude Zeros":
vc.Data.WhereClauseExpression="case when '${SelectType}'='Taxable Income' then ([Total Taxable Income])<>0 when '${SelectType}'='Component Income' and [Group]='O' then ([Value]) <>0 when '${SelectType}'='All' then ([Value]) <>0 end and ([Category] in ($map(\"\'${Components}\'\", \",\")) or [Category] in (\"Taxable Income\"))"
vc.YAxis.Expression="sum(Value)"
vc.ColorAxis.Expression="<[CategoryTest] as []>"
vc.ColorAxis.Coloring.Apply("Color Scheme")
else:
vc.YAxis.Expression="sum(Value)"
vc.ColorAxis.Expression="<[CategoryTest] as []>"
vc.Data.WhereClauseExpression="[Category] in ($map(\"\'${Components}\'\", \",\")) or [Category] in (\"Taxable Income\")"
vc.ColorAxis.Coloring.Apply("Color Scheme")
elif Document.Properties["SelectType"]=="Taxable Income":
vc.YAxis.Expression="sum([Total Taxable Income]) as [Taxable Income]"
vc.ColorAxis.Expression="<[Axis.Default.Names] as []>"
vc.ColorAxis.Coloring.Apply("Color Scheme")
#vc.Data.WhereClauseExpression=""
elif Document.Properties["SelectType"]=="Component Income":
vc.YAxis.Expression="${SelectComponents}"
vc.ColorAxis.Expression="<[Axis.Default.Names] as []>"
vc.ColorAxis.Coloring.Apply("Color Scheme")
#vc.Data.WhereClauseExpression=""
#Cross Table
from Spotfire.Dxp.Application.Visuals import VisualContent
vc1 = viz.As[VisualContent]()
if Document.Properties["SelectType"]=="All":
vc1.MeasureAxis.Expression="${SelectComponents},Sum([Taxable Income]) as [Taxable Income] "
if Document.Properties["AccountName"] == "Exclude Zeros":
vc1.Data.WhereClauseExpression='case when "${SelectType}"="All" then ([Taxable Income]) <>0 OR ($map("([${Components}])", "<>0 Or")<>0 ) end'
else:
vc1.Data.WhereClauseExpression=''
elif Document.Properties["SelectType"]=="Taxable Income":
vc1.MeasureAxis.Expression="Sum([Taxable Income]) as [Taxable Income]"
if Document.Properties["AccountName"] == "Exclude Zeros":
vc1.Data.WhereClauseExpression='case when "${SelectType}"="Taxable Income" then ([Taxable Income]) <>0 when "${SelectType}"="Component Income" then ($map("([${Components}])", "<>0 Or")<>0 ) end'
else:
vc1.Data.WhereClauseExpression=""
elif Document.Properties["SelectType"]=="Component Income":
vc1.MeasureAxis.Expression="${SelectComponents}"
if Document.Properties["AccountName"] == "Exclude Zeros":
vc1.Data.WhereClauseExpression='case when "${SelectType}"="Taxable Income" then ([Taxable Income]) <>0 when "${SelectType}"="Component Income" then ($map("([${Components}])", "<>0 Or")<>0 ) end'
else:
vc1.Data.WhereClauseExpression=''
No comments:
Post a Comment