Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Gauge variable color mapping

Hi -

I am trying to have different sections of a gauge in a pivot table display bars in different colors.  The attached screenshot shows 3 segments (We call a segment 'Tag Group' in the database).  And here is the code I am using to make the color variable:

=IF([Tag Group]='All Households',            red(),

IF([Tag Group]='Age Range',                 blue(),

IF([Tag Group]='Consumer Creditworthiness', yellow(),

IF([Tag Group]='Household Income',          green(),

IF([Tag Group]='Make/Model',                blue(),

                                             LightGray())))))

But the displayed color is always coming out light gray.

Does this function work in QV, and if so then what am I doing wrong?

Thank you!

13 Replies
shree909
Partner - Specialist II
Partner - Specialist II

HI i think its possible,

Could you please post a sample file with limited data.

The other way is try to add different  segments and try to place the lower value  as the as some numeric number.

Thanks

jerem1234
Specialist II
Specialist II

Try wrapping Tag Group in the only function:

=IF(only([Tag Group])='All Households',......

IF(only([Tag Group])='Age Range',......

.....

Hope this helps!

Not applicable
Author

Nope, didn't change anything.

Not applicable
Author

shree ana - Small sample attached.  your help is greatly appreciated!

SunilChauhan
Champion
Champion

HI

PLEASE FIND ATTACHED

HOPE THIS HELPS

Sunil Chauhan
jerem1234
Specialist II
Specialist II

You won't be able control the color of the bar based on dimension, because its an all or nothing deal. It works on the whole set without regard to dimensions.

Hope this helps!

Not applicable
Author

What did you change?  The logic in Properties>Expressions>Gauge Properties>Color Area>Calculated looks the same as what I sent.

SunilChauhan
Champion
Champion

Gauge expression background color

i have used

=IF([Demo Group]='All Households',            red(),

IF([Demo Group]='Age Range',                blue(),

IF([Demo Group]='Consumer Creditworthiness', yellow(),

IF([Demo Group]='Household Income',          green(),

IF([Demo Group]='Make/Model',                blue(),

                                            LightGray())))))

see the attched image

Sunil Chauhan
Not applicable
Author

This ends up with the inverse of the desired result.  Thank you anyway!