Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
arvindjha2050
Creator
Creator

Dynamic Colors of Measures

Hello Team,

In Qlik Sense we are using a line chart with 2 measures and we want custom colors.

Below is the script :

Load * Inline [
SurveyYear,SurveyId,Role,Value
2017,1,HR,1
2017,2,Finance,6

2016,1,HR,7
2016,2,Finance,4

];

 

Dimension : SurveyYear

We have used variable extension with two values ,Value and Count and line chart values should change based on that.

Created a variable named vtest1 with two values Value and Count(Render as Select option)

Measure 1 :  

pick(1 + match(vtest1,'Count'),
Sum(Value),
Count(SurveyId))

Measure 2 :

pick(1 + match(vtest1,'Count'),
Sum({$<Role = {'HR'}>}Value),
Count({$<Role = {'HR'}>}SurveyId))

 

Here we are getting colors blue and red for two measures , how can colors be changed to say green and yellow.

 

Thanks & Regards,

Arvind

Labels (1)
1 Reply
MohammedMustaq
Partner - Creator
Partner - Creator

Hi,,

You can define your own colors to Measures in Qlik Sense.

 

Go to Master Items >>> Create New Measure>>> Paste your Expression>>>>>Measure Name>>>>Define Measure Color.

Use this Master Item Measure in Charts.

Thanks

Mustaq