Skip to main content

New to Qlik Sense

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

cancel
Showing results for 
Search instead for 
Did you mean: 
toedegaard
Contributor III
Contributor III

Qlik Sense: Refer color expression to a Master Item Measure

Hi,

I have created the following Measure in my Master Item List:

Color Measure: If([Risk Status] = 'Controlled' , rgb(68,119,170), if([Risk Status] = 'Critical' , RGB(204,102,119), RGB(221, 204, 119)))

In a number of my charts I want to refer to this master item measure in my color expression instead of typing the expression in in each and every chart.

Is that possible?

Please notice, that I do not use "Color Measure" in the charts so I cannot custom color by measure.

Kind Regards,

Thomas

1 Solution

Accepted Solutions
TKendrick20
Partner - Specialist
Partner - Specialist

Make a variable instead? So the definition of your variable, vColorExp, would be:

=If([Risk Status] = 'Controlled' , rgb(68,119,170), if([Risk Status] = 'Critical' , RGB(204,102,119), RGB(221, 204, 119)))

and your color expression from then on could be:

=$(vColorExp)

View solution in original post

3 Replies
chrisweldon
Contributor III
Contributor III

I don't think you can refer to a Master item in a formula.  I wanted to do that too.  I think they are designed to help with drag and drop visualisations to stop repeating the formula in a Dimension or Measure, but cannot be used as a reference.

I suspect that would be a helpful product enhancement.

Cheers

Chris

TKendrick20
Partner - Specialist
Partner - Specialist

Make a variable instead? So the definition of your variable, vColorExp, would be:

=If([Risk Status] = 'Controlled' , rgb(68,119,170), if([Risk Status] = 'Critical' , RGB(204,102,119), RGB(221, 204, 119)))

and your color expression from then on could be:

=$(vColorExp)

toedegaard
Contributor III
Contributor III
Author

Great! Thanks Tim... Exactly what I was looking for. Haven't worked that much with variables at this point.