BookmarkSubscribeRSS Feed
VictorM
Obsidian | Level 7

Dear all,

Using parameters, I'd like to know if it is possible to have only one Aggregate measure (in a cross table or in a graph for example) that could be either a "Sales" measure (in Euros) or a "Quantity" measure coming from my datasource.

The "switch" from Sales to Quantity would be done using a button bar or a dropdown list.

This way, I have only one object (graph...) and the user can switch easily from one to the other.

I tried but I don't see first How to create a button or a dropdown list that would display "Show Quantity" or  "Show turnover" .

Thanks !

1 REPLY 1
Sam_SAS
SAS Employee

Hello Victor,

 

One approach would be to create a button bar with a 'helper' category assigned to it, where the helper category has the values 'Sales' and 'Quantity'. You would also assign a character parameter to this button bar.

 

Then, you would create a calculated item that would look something like this:

 

IF ( 'helper'p = 'Quantity' )
RETURN 'Quantity'n
ELSE 'Sales'n

 

And when this calculated item is assigned, we get a result like this:

picker.png

 

Depending on the button bar selection, the chart will show the data from either the Quantity measure or the Sales measure.

 

Now, the drawback to this approach is you can only assign one label, one format, and one aggregation for the calculated item. But this might be fine if the data are similar.

 

Let me say here that I am not an expert on all the workarounds of report building, and someone else may have a better way to implement the above approach.

 

The much simpler alternative is to use a stacking container with separate objects for the two measures.

stack.png

Here, there are separate charts for Quantity and Sales, but only one is shown at a time depending on which item in container is selected. 

 

Hopefully one of these approaches will work for you. Let us know!

 

Thanks,
Sam

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 629 views
  • 1 like
  • 2 in conversation