Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
verrdo69
Contributor II
Contributor II

Chart color with selection and drills

Hello guys, i'm new to QlikView

I have a bar chart with some values and 2 dimensions. I put these 2 dimensions in a group. 

Now I'd like to control the colors si I go in expression tab, click on the "+" and add a ondition for the background color.

Capture.PNG

This is the code I use to control the colors:

=if([Logo Fournisseur] = '2', RGB(215,146,93),
if([Logo Marque]='2', RGB(215,146,93),

if([Logo Fournisseur]='0',RGB(145,76,24),
if([Logo Marque]='0',RGB(145,76,24),

if([Logo Fournisseur]='1',RGB(182,109,53),
if([Logo Marque]='1',RGB(182,109,53),

))))))

It works BUT, when select the "2" value, and then I use the drill, all the values display in the drill are the color of the "2" value .(i.e. RGB(215,146,93) )

Capture2.PNG

Could someone help me please? Sorry for my english, this is not my native language.

1 Solution

Accepted Solutions
daveamz
Partner - Creator III
Partner - Creator III

Hi Jean,

Have a look at the attached document. I've simplified the IF statement, I hope that's not too confusing.

Regards,

David

View solution in original post

4 Replies
Anil_Babu_Samineni

Jean, I assume you need to apply code for Group like below

=if(GetCurrentField(CyclicGroupName) = '[Logo Fournisseur]'  or [Logo Fournisseur] = '2', RGB(215,146,93), if(GetCurrentField(CyclicGroupName) = '[Logo Marque]', [Logo Marque]='2', RGB(215,146,93)))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
daveamz
Partner - Creator III
Partner - Creator III

Hi Jean,

Have a look at the attached document. I've simplified the IF statement, I hope that's not too confusing.

Regards,

David

verrdo69
Contributor II
Contributor II
Author

Thanks! Appreciate it but if I select [Logo Fournisseur] = 2 and then, i switch my cyclic group: [Logo Marque], all the "[Logo Marque]" bars are the color of the "[Logo Fournisseur] = 2" bar.

verrdo69
Contributor II
Contributor II
Author

Thank you, it's a bit confusing, i change your LOAD to create some data like mine and it seems to work, i'll try to adapt it with my model. I didn't know about Pik function.

It seems to work with my "logo" chart. I'll try to adapt this method with all the chart.

Thank you so much.