Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
Not applicable

Custom color measurements

Hello everybody,

Here comes another color question. I have a chart that looks like this:

Skärmklipp.PNG

I have 1 dimension and 2 measures:

Skärmklipp 01.PNG

Gross margin is calculated like this:

Skärmklipp 02.PNG (for those who want to know).

I would like to be able to custom color my measure (Gross Margin). Can anyone tell  me how to do it?

Sincerely,

Betty Habtemariam

2 Replies
brunobertels
Valued Contributor II

Re: Custom color measurements

Hi Betty

May be somethink like this :

ColorMix1(

((Sum(Sales)-sum(COGS))/Sum(Sales)-$(=min(aggr( ((Sum(Sales)-sum(COGS))/Sum(Sales), [Month])))))

/

$(=(max(aggr(((Sum(Sales)-sum(COGS))/Sum(Sales),[Month]))-min(aggr(((Sum(Sales)-sum(COGS))/Sum(Sales), [Month])))))),white(),blue())

Hope it helps

Bruno

reddys310
Honored Contributor II

Re: Custom color measurements

Hi Betty,

As you have the gross margin as one of he measures , you will be able to colour code the chart with just an if statement like this:

if( (sum(sales)-sum(cogs))/sum(sales) > 0.5,green(), // greater than 50% green

if( (sum(sales)-sum(cogs))/sum(sales) < 0.2,red(), // less than 20% red

blue())) // else blue

Thanks,

Sangram