Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Master
Master

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

reddy-s
Master II
Master II

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