Hiding and Showing Data in a Visualization


Many times when dealing with large datasets, users have a need to filter to relevant data within a specific visualization. However, they want to do it in a way that the full data set is still used to ensure correct expressions and calculations are applied.  For example, in a Bar Chart, users may only want to see the top 5 and bottom 5, but not all the ones in the middle. This can be accomplished in 5.5 using the ’Show-Hide Items’ option within a visualization.

If you look at the Bar Chart below there are lots of categorical values on the Category Axis and it makes it hard to interpret.

Hide Show 

 
What if you did not care about how a specific category compared to all others, but you just wanted to see how a specific category compared to the top and bottom 5 in that grouping?


With Spotfire 5.5, you have the option to add rules to hide and show data. This is available from the ’Show/Hide Items’ option on the Visualization’s Properties dialog.

Hide Show 2 

 
By clicking on the ‘Add’ button from within the Show/Hide Items option, you can add in rules similar to the Conditional Coloring rules.  When defining a rule, you can specify whether the rule will be used to hide items or show items. For this specific example, we can add a rule that shows we will show the top 5 values for the ‘Sum(Sales)’ expression.

We can then add another rule which says to show the bottom 5 values for Sum(Sales). 

Next we can add an ‘Equal to’ rule and then set the value either as a hard coded value or as an expression and set it to the name of the specific value in the category column. In this case we are analyzing sales across various product categories from the ‘Product Category 3’ column so we use the following expression: First([Product Category 3]). We can hard code one specific product category, ie ‘METAL BOOKCASES’

Hide Show 3 

NOTE: If adding the value using the ‘Value’ option, you don’t need to add quotes around your string. If you add it via the Expression option, you do need to add quotes.

 Hide Show 4

Our Bar Chart should now show the top 5 and bottom 5 values as well as a bar for our specific category METAL BOOKCASES.

Hide Show 5 


Then we can go into the Color axis and add an expression that will color the specific value we just added (METAL BOOKCASES) differently than the others so it is called out (NOTE we could have also done this by adding in a coloring rule)

Hide Show 6 

To take this example even further, using Property Controls, we can add a Drop Down Control that allows the user to select a value from the Property Category Column.  We can then use this to dynamically update the show/hide rule and color expression. This will allow the user to select a specific value, and display and color that value compared to the top 5 and bottom 5 in the Bar Chart.

 Hide Show 7

In addition, another nice enhancement in 5.5 is the ability to use Properties inside a visualization title. Now we can update the Drop Down Control to select a product category and have the title dynamically reflect this.
 

Hide Show 8

 

Hide Show 9