Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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(

Anonymous
Not applicable
Author

Where should I insert aggr(?

stiffi88
Partner - Contributor III
Partner - Contributor III

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

Anonymous
Not applicable
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 - Contributor III
Partner - Contributor III

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

Anonymous
Not applicable
Author

Hi,

Its the screenshot I inserted earlier.

qlik.JPG

stiffi88
Partner - Contributor III
Partner - Contributor III

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

Anonymous
Not applicable
Author

Hi,

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

HarishG
Partner - Contributor III
Partner - Contributor III

try this

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