Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Re: Gauge variable color mapping

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

Re: Gauge variable color mapping

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

Re: Gauge variable color mapping

Nope, didn't change anything.

Not applicable

Re: Re: Gauge variable color mapping

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

chauhans85
Esteemed Contributor

Re: Re: Re: Gauge variable color mapping

HI

PLEASE FIND ATTACHED

HOPE THIS HELPS

jerem1234
Valued Contributor II

Re: Gauge variable color mapping

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

Re: Re: Re: Gauge variable color mapping

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

chauhans85
Esteemed Contributor

Re: Re: Re: Re: Gauge variable color mapping

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

Not applicable

Re: Re: Re: Gauge variable color mapping

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

Community Browser