JP Lee Posted November 8, 2022 Share Posted November 8, 2022 Here is an expression for the Y axis of a scatter plot, which uses "as" at the end of the entire expression to rename the axis label:if( "${TimeAxisType}" = "A", uniqueCount([XYZ]) over (Intersect([Axis.X],[Axis.Panels])), //simple count uniqueCount([XYZ]) over (Intersect(AllPrevious([Axis.X]),[Axis.Panels])) //cumulative count ) as [count]I want to change the label based on the chosen expression however - something like this:if( "${TimeAxisType}" = "A", uniqueCount([XYZ]) over (Intersect([Axis.X],[Axis.Panels])) as [count], //simple count uniqueCount([XYZ]) over (Intersect(AllPrevious([Axis.X]),[Axis.Panels])) as [cumulative count], //cumulative count )But this yields a syntax error. My actual example has five of these subexpressions in the if() expression. Is there any way to do this? thanks,JP Link to comment Share on other sites More sharing options...
Fredrik Rosell Posted November 9, 2022 Share Posted November 9, 2022 Hello JP,You can only set "as" on the top level. Maybe you could handle this using two document properties, adding an additional property for the axis label. So, I now have these properties: AxisTypeAxisLabelMy plot-axis expression is this:If( "${AxisType}"="A", [Population], [urban Population %]) as $esc(${AxisLabel})I add a script on the AxisType property, that will run when it changes, to set the AxisLabel if Document.Properties["AxisType"]=="A": Document.Properties["AxisLabel"] = "A title"elif Document.Properties["AxisType"]=="B": Document.Properties["AxisLabel"] = "B title" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now