Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QLIKWORLD LIVE! MAY 16 - 19TH, EARLY BIRD DISCOUNTS! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
fgillen1
Contributor III
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
Creator
Creator

try AGGR(

fgillen1
Contributor III
Contributor III
Author

Where should I insert aggr(?

stiffi88
Partner
Partner

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
Contributor III
Contributor III
Author

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
Partner
Partner

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

fgillen1
Contributor III
Contributor III
Author

Hi,

Its the screenshot I inserted earlier.

qlik.JPG

stiffi88
Partner
Partner

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

fgillen1
Contributor III
Contributor III
Author

Hi,

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

HarishG
Partner
Partner

try this

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