I’m trying to use a calculated field with an ifelse expression to allow me to use controls to change the data being viewed in a graph. I have a LAC expression that is the following:
I want the metricselection control to adjust for the values that the graph displays, but the above ifelse does not work with LAC agg expression according to the error message. What can I do about this? Is there another way of setting this up?
That’s just example expression I got from another person that was using that above ifelse statement with a control called metricselection with those text parameters (i.e. “new_cases”, “new_cases_per_million”). I was trying to mimic that using my own data but LAC expressions don’t seem to work with an ifelse expression.
I have created a table and allow user to choose “MetricSelection” for either “NewCase1” or “NewCase2”. If user choose “NewCase1”, it is doing a summation for column “Quantity”. If user choose “NewCase2”, it is doing a summation for column “Quantity2”. Is it what you are looking for?
@royyung What you suggested was part of the solution. I realized that there was an issue with the original calculated field. I needed to add the ${visualDimensions} parameter to take into account the field well of date. But yes, the sum calculation was what allowed me to get the ifelse statement to work.