Hi everyone,
I need to create a kpi with a measure where i can count the number of selection in a global filter. This filter have multiselection and is Date type. Thanks
You should be able to do this by creating a Distinct Count of your Date data item, then using that new measure in the KPI.
1. Right-click on the Date data item and select New Calculation
2. First option should be Distinct so create that
3. Use that distinct count in the KPI
4. Ensure the list control filters the KPI.
Now by doing this if you have 0 selections in the list, then the KPI is going to show a distinct count of all date items (because it's not being filtered by anything). If you need the KPI to show 0 then you can take the following extra steps:
1. Right-click on the List control and select New Parameter
2. Create the new parameter, you shouldn't need to make any changes to it aside from the name if you want
3. Back on the KPI, add a local filter that does something like this:
This is checking to see if the Date Parameter is set (meaning at least one selection has been made). If so, then we return true, else we return false.
When it's all done it should work like this:
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.