Please find the attached requirement and pls help its urgent.
The selector I used is kind of a hack, but I'm not sure if there's a better way to do it.
For a button bar control, you need a column that has the values for the button labels. It doesn't really matter which rows off the table these values are in.
To create the label column, let's make a custom category:
So your Custom Category window should look like this:
The button bar will set the value of a parameter, so let's create that parameter now.
Now, we need to create the "Completed" calculated item.
IF ( 'Parameter 1'p = 'ASCompleted' ) RETURN 'AS Completed'n ELSE ( IF ( 'Parameter 1'p = 'DSCompleted' ) RETURN 'D sCompleted'n ELSE ( IF ( 'Parameter 1'p = 'FSCompleted' ) RETURN 'FSCompleted'n ELSE 'PSCompleted'n ) )
Now, we put it all together:
Now you should be able to select the button bar and see the values in your visualizations change. In the sample data you provided, the first two Completed columns have the same total but the other two should show a change when you select them.
One of the limitations of this approach is that report filters might hide some of your button label values. A workaround to that is to make your label column by using a calculated expression using the endsWith() operator to set all the rows where ApplicationID ends in 1 to one label, ApplicationID ends in 2 to another label, and so on. You don't have to worry about this if you don't have report-level filters.
This is all a bit tricky and it would be easier if your data had a different structure. But that is not always something we can control.
Let me know if there is more I can help with,
Sam
Hello,
I'd like to help, but it is difficult to understand exactly what you want to do. Your requirements document doesn't quite match the sample data provided.
If you make a hierarchy of Division > District, you can get a crosstab with totals like this:
If you want the zeroes to be missing values, you can create calculated measures like this:
IF ( 'AS Completed'n = 0 )
RETURN .
ELSE 'AS Completed'n
If you want a different kind of result, please try to create an example of how it should look in Excel or another tool.
Thanks,
Sam
I want total value of the variable to be displayed. But for me it displays 0 and 1 in filter. Instead I just want total.
Eg.
D completed
0
1
0
1
-----
2
So it should come 2 instead of 0 and 1.
It still is not clear what you want. In which type of visualization do you want to see the totals? In a list table? In a crosstab?
If the values (0, 1, 0, 1) are giving you 1, check to see if the aggregation for this measure is something other than Sum.
Does it have to be a hierarchy?
What about a button bar that would enable the user to select the stage?
In this example, the "Completed" measure will show the total for the column that is selected in the button bar.
It takes a bit of work to implement this kind of selector, but I can show you how if this would meet your needs.
Sam
The selector I used is kind of a hack, but I'm not sure if there's a better way to do it.
For a button bar control, you need a column that has the values for the button labels. It doesn't really matter which rows off the table these values are in.
To create the label column, let's make a custom category:
So your Custom Category window should look like this:
The button bar will set the value of a parameter, so let's create that parameter now.
Now, we need to create the "Completed" calculated item.
IF ( 'Parameter 1'p = 'ASCompleted' ) RETURN 'AS Completed'n ELSE ( IF ( 'Parameter 1'p = 'DSCompleted' ) RETURN 'D sCompleted'n ELSE ( IF ( 'Parameter 1'p = 'FSCompleted' ) RETURN 'FSCompleted'n ELSE 'PSCompleted'n ) )
Now, we put it all together:
Now you should be able to select the button bar and see the values in your visualizations change. In the sample data you provided, the first two Completed columns have the same total but the other two should show a change when you select them.
One of the limitations of this approach is that report filters might hide some of your button label values. A workaround to that is to make your label column by using a calculated expression using the endsWith() operator to set all the rows where ApplicationID ends in 1 to one label, ApplicationID ends in 2 to another label, and so on. You don't have to worry about this if you don't have report-level filters.
This is all a bit tricky and it would be easier if your data had a different structure. But that is not always something we can control.
Let me know if there is more I can help with,
Sam
If you make it character, the values cannot be aggregated (1+0+0+1+1 = 3). If you want to have the totals, the values must be numeric.
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.