Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Insider - Maximize your investment, Join this webinar, May 26th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
nikitapuniani
Contributor II
Contributor II

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
Champion III
Champion III

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())

nikitapuniani
Contributor II
Contributor II
Author

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

nikitapuniani
Contributor II
Contributor II
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

nikitapuniani
Contributor II
Contributor II
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.