Hi all,
Is it possible to select variables or columns to include in an object like list table or crosstab? For example, I have a data set like this.
Attribute Name Station Size Region Value Size_0_15 Size_16_40
Salaries A 0_15 Region A 150000 167580 850789
Salaries B 16_40 Region B 760785 167580 850789
When I filter the report with Station = A, I want the column Size_0_15 is displayed next to the Value, like:
Attribute Name Station A Size_0_15
Salaries 150000 167580
But when I filter it with Station = B, I want the column Size_16_40 instead, like:
Attribute Name Station B Size_16_40
Salaries 760785 850789
Thanks in advance,
Cokey
You can do this by using a calculated data item and a parameter.
I assume that you have a button bar or other filter control object that selects between Station A and Station B?
If you create a parameter and assign it to the control, then you can use the parameter value in your calculated item. The expression might look like this:
IF ( 'Parameter 1'p = 'Station A' ) RETURN 'Size_0_15'n ELSE IF ( 'Parameter 1'p = 'Station B' ) RETURN 'Size_16_40'n ELSE ''
Now you can assign this calculated item to your objects.
Let us know if that helps,
Sam
Hi Sam,
Thanks for the tips. This solved half of my problem.
The content of the different columns can be displayed using this formula, but the column header is not dynamic still. right?
Cokey
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.