Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Krish
Contributor III
Contributor III

Change Background color of a dimension in Qliksense Pivot table

Hi,

  I have a dimension in pivot table which needs to be have different color codes based on the dimension value. 

Eg:

          If(Country = 'US','RGB(255,0,0)', If(Country = 'EU','RGB(0,255,0,)',RGB(0,0,255)')

The Background color in dimension works only for 1 color code and does not work for multiple if conditions. How can this be achieved.

Labels (1)
19 Replies
Krish
Contributor III
Contributor III
Author

@neerajthakur  I did try using the conditions as you mentioned. 

=if(num([Workload.Risk_Score],'#.##')=2.40,red(),blue())

It goes to Else Part.

Also, it is a dimension and I am not using any other calculation for this dimension.

neerajthakur
Creator III
Creator III

Don't know what's happening would suggest you to try in a separate app using inline load.

Does all the values end with 0 in your case then try this expression

=if(num([Workload.Risk_Score],'#.#0')=2.40,red(),blue())

Share screenshot from Model Viewer of that field from Preview Pane, I want to see the Tags there, if it's not numeric then try making it using Num() or Num#()

Thanks & Regards,
Please Accepts as Solution if it solves your query.
Krish
Contributor III
Contributor III
Author

Thanks for you response. 

Does Vizlib not support this feature?

Clever_Anjos
Employee
Employee

I´d rather use a pick

pick(Match(Country ,'US','EU','LATAM'),
RGB(255,0,0),
RGB(0,255,0),
RGB(0,0,255),
)

Krish
Contributor III
Contributor III
Author

But Pick might work when the value is 2.4, 1.5 etc., but my requirement is that

if Score is GE 3.5 --> Green

if Score is between 2.5 and 3.4 --> Blue

if Score LE 2.4 --> Red

 

ajaykakkar93
Specialist III
Specialist III

hi,

i guess column => [Workload.Risk_Score] is added as a measure i.e =sum([Workload.Risk_Score]) ? 
if that so then try this 

=if(column(NUMBER)=2.40,red(),blue())

make sure to write the correct column i.e column(1) or column(2)

 

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

vinieme12
Champion III
Champion III

format HEX codes as below

 

=if([Workload.Risk_Score]=2.40, Num#('#00FF00','HEX'), NUM#('#FFFF00','HEX'))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Krish
Contributor III
Contributor III
Author

Hi @vinieme12 & @ajaykakkar93 . I tried both. It just doesn't work. Is it a limitation with Vizlib. This works with normal pivot table, but not with Vizlib.

Clever_Anjos
Employee
Employee

Sorry, got confused by your example

 

neerajthakur
Creator III
Creator III

It might, would suggest to raise issue with VizLib support.

Thanks & Regards,
Please Accepts as Solution if it solves your query.