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
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 16. Read more here about why you should contribute and what is in it for you!
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.