Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

fgillen1
New Contributor III

Pivot Table - Background Colour by Expression

Hi All,

I am trying to create a conditionally formatted pivot table. I am trying to use the colormix2 function in the Background color expression box to create the conditional formatting, however it is only throwing one color out.

ColorMix2((Count(DISTINCT {<status={'1'}>} UNIQUE_ID)/

Count(DISTINCT UNIQUE_ID)) , rgb(180,212,218), rgb(28,95,158))

Has anyone any ideas how I could modify this code in order to have 4 distinct colors based on the min to max values in the table?

qlik.JPG

Regards

Finbar

11 Replies
thevingo
Contributor

Re: Pivot Table - Background Colour by Expression

try AGGR(

fgillen1
New Contributor III

Re: Pivot Table - Background Colour by Expression

Where should I insert aggr(?

stiffi88
New Contributor III

Re: Pivot Table - Background Colour by Expression

Hi Finbar,

you can watch at your calculation. Maybe the Values are near to the same.

Just put this as an Measure on your table:

(Count(DISTINCT {<status={'1'}>} UNIQUE_ID)/

Count(DISTINCT UNIQUE_ID))

I testest your Colormix function. For me it's working

fgillen1
New Contributor III

Re: Pivot Table - Background Colour by Expression

Hi stiffi88,

I have this as the measure

(Count(DISTINCT {<status={'1'}>} UNIQUE_ID)/

Count(DISTINCT UNIQUE_ID))

but for some reason it isn't creating distinct colors from the code i have inputted in the background color expression. The range is from around 90% to 100%.

stiffi88
New Contributor III

Re: Pivot Table - Background Colour by Expression

Can you paste a screenshot from the result from these Measure?

fgillen1
New Contributor III

Re: Pivot Table - Background Colour by Expression

Hi,

Its the screenshot I inserted earlier.

qlik.JPG

stiffi88
New Contributor III

Re: Pivot Table - Background Colour by Expression

Can you maybe share your qvf file with some example data?

fgillen1
New Contributor III

Re: Pivot Table - Background Colour by Expression

Hi,

I can't share the data due to company policy, sorry!

HarishG
New Contributor III

Re: Pivot Table - Background Colour by Expression

try this

ColorMix1( rank(total EXPRESSION ) / NoOfRows(TOTAL) , $(vColorMixDark), $(vColorMixLight))

Community Browser