We’re smarter together. Learn from this collection of community knowledge and add your expertise.

3 ways to use hidden data roles in SAS Visual Analytics 8.2

by SAS Employee SteveMellgren on ‎01-03-2018 09:30 AM - edited on ‎01-03-2018 09:53 AM by Community Manager (1,807 Views)

You’ve built a report in SAS Visual Analytics (VA) 8.2, but you’re not quite done.  You want to apply a color-mapped display rule to highlight a category in a list table.  Easy enough, right?  But you don’t really want to display the category that is the basis of the color-mapped display rule.  What can you do?  

 

Or maybe you want to map data sources between two objects, but not display the category that is used in the data source mapping.  Can it be done?  Both these scenarios can be accomplished in VA 8.2 if you use hidden data roles.

 

Hidden data roles enable you to include a data item in the query results when you want its values, but do not want it to be displayed.  There are three ways you can use hidden data roles: 1) color-mapped display rules, 2) mapping data sources and 3) external links.  In this article I will walk through examples for the first two.

 

1) Color-mapped display rules
The following example is a simple list table: MSRP (avg) by vehicle make and origin.  Each vehicle make is manufactured by a company headquartered in one of three continents.  A simple color-mapped display rule was created to color each line based on continent origin.

 

hidden_1.png

             

But what if I don’t want to display the origin as one of my columns?  The color already tells me the origin, so that column is redundant.  But if I remove origin from my list table, the color-mapped rule cannot apply, since origin is not part of the query results.  It’s starting to feel like one of those circular arguments.  Below is the same list table, with origin removed.

 

hidden_2.png

 

The list table requires origin to be part of the query to correctly display the color-mapped rules.  This is where hidden data roles come into play.  To get this to work as described above, all you need to do is add origin back to the list table.  Not as the data role you are familiar with, but as a hidden data role.  Once added, origin is now part of the query results.  The color-mapped display rule can apply.  But since it is hidden, it does not display in the list table. 

 

hidden_3.png

 

How easy was that?  But don’t be fooled by the simplicity of this new data role.  It is quite powerful.  And it can be used in other ways. 

 

 

2) Mapping data sources
In previous versions of VA, when it came to data source mapping between objects, only visible categories in a source object could interact with the target.  In VA 8.2, hidden data roles lift that restriction. 

 

In the data source for our first report, one category I haven’t introduced yet is “Make_Code”.  This is a 4 digit code for a manufacturer name.  I will need this code because I want to link from this table of manufacturers to a detail table with some specific information regarding each vehicle model.  However, the detail table does not have “Make”.  It only has the 4 digit code in the field “Make_cd”.  The report below shows the original report on the left, with “Make_Code” added.  It also shows a detail list table of variables on the right, including “Make_cd”.  The make codes are the categories that will allow me to map our data sources.

 

hidden_4.png 

 

As in previous versions of VA, if my report displayed these codes I could map these 2 tables and be done with my report.  But the codes don’t mean anything to my end users, so I want to map the data sources without displaying them in either table.  Once again I will rely on a hidden data role.

 

If I remove “Make_Code from the first table, and then try to map the data sources, I am unable to map data sources since “Make_Code” is not part of the source query.  Below you can see that I’m trying to map “Make_Code” to “Make_cd”, but the [OK] is grayed out.  I am unable to proceed.

 

hidden_5.png 

 

I’ll bet you can guess where this is going now.  If I add “Make_Code” as a hidden data role, I will be able to map the data sources, without it displayed in the table.

 

hidden_6.png

 

With the new hidden data role added, the data source mapping of “Make_Code” to “Make_cd” in now enabled.  The [OK] is no longer grayed out and I am able to proceed.  Categories assigned to a data role in the source object, whether visible or hidden, can now interact with the target. 

 

hidden_7.png

 

With mapping now complete, when I click on one of the manufacturers in the “Make” column of the left table, the detail is filtered.  Even with the mapping source hidden.

 

hidden_8.png

 

The example above was created to show you how to base interactions on a code, without the need to show it in a report.  This could just as easily been product names and codes or customer account names and numbers. 

 

3) External links

The third way to leverage hidden roles is with external links.  I won't detail an example here, but the same principles apply.  The only difference would be the target of the link would be a URL instead of a report object.

 

If you get a chance to work with the new release of VA 8.2, look for the hidden data role.  This is a great new way of working with data role assignments.  Click here to view this section of the VA 8.2 user guide.  To get you started, I even attached a simple Excel file that supports this example. 

 

While hidden data roles are not available for all objects, you may find that hiding a data role is exactly what you need.  Happy Visualizing!

Contributors
Your turn
Sign In!

Want to write an article? Sign in with your profile.


Looking for the Ask the Expert series? Find it in its new home: communities.sas.com/askexpert.