Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qliksense server change color coding using expression

Hello Qliksense experts,

I am new to qliksense server and need some help on a scenario I am working on.

I am doing a bar chart comparison of sum(cost) on a dimension using set analysis.

Now I need to change the color scheme to blue and light grey.

Here is what I am trying to do but results are not working. Also please note that this is qliksenser server and the version is as of Sep 2017

---

I have created two measures

Measure1=sum({<RuleType='Existing'>}Cost)

Measure2=sum({<RuleType='New'>}Cost)


To change the color scheme I am applying the following expression that is not working


if(RuleType='Existing', lightgray(),blue())

Also tried if(RuleType='Existing', lightgrey(),if(RuleType='New',blue(),red()))

Can someone help me get the bar chart color to lightgrey for measure1 and blue for measure2 ?

Thanks,

Nikita



6 Replies
MK9885
Master II
Master II

whts the dimension name here, RuleType?

Chanty4u
MVP
MVP

is this measures working?

Measure1=sum({<[RuleType]={'Existing'}>}Cost)

Measure2=sum({<[RuleType]='New'}>}Cost)

then

if([RuleType]='Existing', lightgray(),blue())



or



If(Match([Rule Type],Exisitng), lightgrey(),blue())

MK9885
Master II
Master II

I think there was a syntax error in your expression...

Use below expressions.

Exp1: sum({<RuleType={'Existing'}>} Cost)

Exp1: sum({<RuleType={'New'}>} Cost)

In appearances use below color code

if( RuleType='Existing', lightgray(),blue())

Anonymous
Not applicable
Author

yes RuleType is a dimension having two values- new and existing

Anonymous
Not applicable
Author

Shahbaz, Thanks !

Although thats not the issue. I have used if( RuleType='Existing', lightgray(),blue()) and it doesnt work

Not sure what the issue is. This is a server version

Anonymous
Not applicable
Author

The issue has been resolved. The reason why it was not picking the color was because the dimension was a Drill down.

So I had to first create a dimension RuleType and then add drill down dimension.

The expression worked fine using the if clause as suggested.

This also eliminated the need to do the sum(measure) using set analysis.