BookmarkSubscribeRSS Feed
znhnm
Quartz | Level 8

Hi, 

 

I am using displays rules on my VA report to add some color coding on my list table. However, I would like to create a display rule, depending on a 2 variable, not 1.

For example, let's say I have age column and also salary column, and also another calculated column called index, where I add the colors.
I would like to fill the index column to green, if age>18 and salary>1000. 
I would like to fill the index column to yellow, if age>30 and salary>5000.

So, as you can see the rules depend on both age and salary. 

I don't think it is possible to do that on UI, please let me know if it is, but also please let me know if you can think of a workaround to do that. 

5 REPLIES 5
HunterT_SAS
SAS Employee

You should be able to do this by creating a calculated item for your condition first, something like:

IF ( ( 'Age'n > 30 ) AND ( 'Salary'n > 5000 ) )
RETURN 'yellow'
ELSE (
IF ( ( 'Age'n > 18 ) AND ( 'Salary'n > 1000 ) )
RETURN 'green'
ELSE 'red' )

 

Then use that calculated item in your display rule. 

znhnm
Quartz | Level 8
It allows me to apply a display rule only using the variables on the list table. I created a calculated item but as long as it is not in the list table, I can't use it to apply a display rule. Thanks for the suggestion, though.
HunterT_SAS
SAS Employee

Could you not add the calculated item to the Hidden role for the list table? That should allow it to work in the display rule. 

znhnm
Quartz | Level 8
This is what I wanted to try also but the list tables do not have hidden roles. 😞
HunterT_SAS
SAS Employee

Really? What version of Visual Analytics are you using? List Tables have had the Hidden role for years now. 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 5 replies
  • 1209 views
  • 0 likes
  • 2 in conversation