Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Applying parameter to aggregated measure

Reply
Contributor
Posts: 47

Applying parameter to aggregated measure

Hi,

 

I am trying to create a button bar which will be used to filter a chart. There are two measures that I would like to user to toggle between (Measure 1 and Measure 2), which I have assigned to a parameter, "Parameter".

 

I am now trying to create the calculated item, which, if Parameter = Measure 1 will give Aggregated 1, and if Parameter = Measure 2 will give Aggregated 2, as per the below:

IF ('Parameter'p = 'Measure 1')

RETURN 'Aggregated 1'n

ELSE (

RETURN 'Aggregated 2'n)

 

However, I'm getting an error relating to 'Measure 1', reading "An element cannot be aggregated"

And another error related to the if statement, reading "Operand can only be aggregated, but this operator does not support aggregation.

 

Any ideas what I'm doing wrong? Can I not use aggregated measures in an if statement like this?

 

 

Occasional Contributor
Posts: 8

Re: Applying parameter to aggregated measure

Posted in reply to MikeFranz

I have faced a similar issue in SAS VA 7.3 before. Instead of creating a button to filter the chart, how about creating two different charts and placing them into a stack container? The user can select the chart they want to see that way as well.

 

Hope that works!

Anurag

New User
Posts: 1

Re: Applying parameter to aggregated measure

Posted in reply to MikeFranz

hi MikeFranz,

 

 

 

You can do the same using parameter but before creating and assigning a parameter you need to create an excel file have single column (let say Dynamic Measure) with the values as measures (Measure1, Measure2 Measure3,..) that you have to filter into the chart. Load the excel table in to lasr and add that lasr table to your report. Use the variable Dynamic Measure in the button bar. Now Create a categorical parameter and then create a calculated item like

IF ('Parameter'p = 'Measure 1')

RETURN 'Measure1'n

ELSE (

RETURN 'Measure2'n)

 


Hope this will work for you.

Anand
Regular Contributor
Posts: 191

Re: Applying parameter to aggregated measure

Posted in reply to MikeFranz

Hi there,

if you first create a calculated field with the if then else parameter realation it will work.

the new calculated field can be used in any further aggregated measure.

this works for me.

greetings. Peter.

Ask a Question
Discussion stats
  • 3 replies
  • 287 views
  • 0 likes
  • 4 in conversation