BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
akychong
Calcite | Level 5

Is it possible to apply display rules to only one categorical value instead for all value in a column.

For example, in the attached crosstab can I apply display rules to only FICO bucket ">=660" if Percent of column total is less than 70%?


Crosstab 1.png
1 ACCEPTED SOLUTION

Accepted Solutions
Renato_sas
SAS Employee

Hi @akychong,

 

I've thought of a workaround that hopefully works for you. In the example below, we want to only highlight percentages > 7.8% where Produc Brand = Novelty. By default, a display rule defined on Frequency Percent would highlight cells in the Toy row as well.

 

Default behavior

 

Solution: create a flag that is 1 only if the logic above is true (Frequency Percent > 7.8% and Produc Brand = Novelty), otherwise it's 0, then use this flag to define the display rule.

 

Downside: the new flag column needs to be added to the crosstab so it can be used in the display rule.

 

The first thing we need to do is identify the rows for Novelty. We do that by creating a calculated item called Is Novelty:

 

Expression for Is Novelty

 

Next we are going to create the Flag as an aggregated measure:

 

Expression for Flag

 

Now we can add the Flag in the crosstab and define the display rule that looks like this (that's the only display rule needed - you can remove the one used initially):

 

Display rule.PNG

 

Final result

 

To minimize the side effect and make the Flag column less noticeable, you can rename it to . (a dot) and define a display rule for this column that makes the font color the same as the background color.

 

Best,

Renato

View solution in original post

4 REPLIES 4
Renato_sas
SAS Employee

Hi @akychong,

 

I've thought of a workaround that hopefully works for you. In the example below, we want to only highlight percentages > 7.8% where Produc Brand = Novelty. By default, a display rule defined on Frequency Percent would highlight cells in the Toy row as well.

 

Default behavior

 

Solution: create a flag that is 1 only if the logic above is true (Frequency Percent > 7.8% and Produc Brand = Novelty), otherwise it's 0, then use this flag to define the display rule.

 

Downside: the new flag column needs to be added to the crosstab so it can be used in the display rule.

 

The first thing we need to do is identify the rows for Novelty. We do that by creating a calculated item called Is Novelty:

 

Expression for Is Novelty

 

Next we are going to create the Flag as an aggregated measure:

 

Expression for Flag

 

Now we can add the Flag in the crosstab and define the display rule that looks like this (that's the only display rule needed - you can remove the one used initially):

 

Display rule.PNG

 

Final result

 

To minimize the side effect and make the Flag column less noticeable, you can rename it to . (a dot) and define a display rule for this column that makes the font color the same as the background color.

 

Best,

Renato

david27
Quartz | Level 8

@Renato_sas 

Has there been any progress on this since 2016?

 

Visual Analytics is generally used to present reports to senior management. Having an unnecessary column like that just does not sound right.

 

Regards

AndreaZimmerman
SAS Employee

You can now add such columns as a Hidden column which prevents them from being displayed, but still allows conditional formatting to be based on them.

DJVA
Calcite | Level 5

@AndreaZimmerman Thanks for the update, but this isn't an option in crosstab objects which the original question is about, at least not in version 7.51 (build date = August 2021). 
I have a similar use case: I have a cross tab with two aggregated measures, say x and y, I want to apply conditional formatting based on the difference between those two. Said difference is captured in a third aggregated measure (x - y basically).

The solution from  @Renato_sas works functionally, but it's not pretty - if I can somehow fully hide the column which captures the difference that'd be great.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 4 replies
  • 5284 views
  • 7 likes
  • 5 in conversation