Hello All,
There are multiple examples of what I am trying to do here - create dynamic dimensions within VA, to illustrate how a numeric field is broken by different categorical variables:
http://support.sas.com/resources/papers/proceedings15/SAS1854-2015.pdf
http://blogs.sas.com/content/sgf/2016/04/27/use-parameters-to-pick-your-metric-in-visual-analytics-reports/#comment-192050
but I'm not quite getting the results I want - in step 1: creating a custom category, the field used as a source for the custom category does matter, it subsets the resulting dashboard (whereas the walk-throughs say the source field should not matter so long as the cardinality is large enough to accommodate the results). So I'm going to create a basic example to illustrate my problem... I'm goign to follow the SAS paper, though the blog example is quite similar.
Prelims: Create dummy data... and put it on AUTOLOAD / LASR etc...
Dummy Data:
data que; input cat1 $ cat2 $ cat3 $ cat4 $ num1 ; cards; Z S B C 0.296545295 F X I Q 0.555111915 D R M V 0.257882082 C B W R 0.820439665 L L F J 0.653780736 F C K K 0.405469842 O N Y J 0.756141762 N C K B 0.069636594 Y R H B 0.166439445 Z N M Q 0.726950181 ; run;
1. Create a custom Category
I'll use cat1. Since it has more than 4 levels, this should be appropriate. The two walk-throughs differ as to whether or not to use "Group remaining values as Other"...I will follow the paper and bin all levels of cat1 to avoid "Group remaining values as Other". (See Custom_Category_VA).
2. Create button bar, drag Custom_Category_VA on to it (e.g. Roles: Category: "Custom_Category_1"), remove Role:Frequency for aesthetics.
3. Create a parameter, Type=Character. Click OK.
4. Create a Calculated Item. This is the hard part and likely where I've made a mistake. The paper provides several pages of interacting with the drag/drop Expression builder. Here, I will use the "Text" option and share the code (following the blog example).
IF ('Parameter 1'p = 'cat1' ) RETURN 'cat1'n ELSE ( IF ( 'Parameter 1'p = 'cat2' ) RETURN 'cat2'n ELSE ( IF ( 'Parameter 1'p = 'cat3' ) RETURN 'cat3'n ELSE ( 'cat4'n)))
4. Putting it all together: Put a barchart in the report, so we have something to look at. Create an interaction from the button bar to the barchart. Barchart: Roles: Category: "Calculated Item (1)" and Measures: "num1"... however, this does not work. The bar chart displays the values contingent on the original Step 1 Custom Category...
* clicking the button bar cat4 gives a bar chart with categories of Z,O,Y (cat1 has 8 distinct levels C,D,F,L,N,O,Y,Z)
* clicking the button bar cat3 gives a bar chart with categories of F,L,N
* clicking the button bar cat2 gives a bar chart with categories of D
* clicking the button bar cat1 gives a bar chart with categories of C
I'm using SAS Visual Analytics Designer Version: 7.3 Hotfix 03
Thank-you for any help you might provide,
Wes
... View more