Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
NikosSpanos
Contributor III
Contributor III

In a pivot cell color two values with different color Qlik Sense Enterprise

I have created the pivot table below (also attached its qvf file):

Screenshot_2.png

I would like to color the values inside (parenthesis) with a different color if the value is positive or negative and the text outside the parenthesis to be black. Currently I used a report variable to calculate values in the parenthesis. And using the text color expression setting of the measure I managed to color the values. However it colors the whole cell and not only the values related to the page variable inside the parenthesis.

You can find my implementation qvf file attached.

4 Replies
rbartley
Specialist II
Specialist II

Hi, I'm not aware of a way of specifying different colours within a column, but you can show what you have asked for in 2 different columns.  The reason why both of your values appear in green, rather than one in green and one in red is that you need to reference the variable doubleColor using $(doubleColor), e.g.

 

if($(doubleColor)>0, green(), red())

 

QC_DoubleColor.GIF

 

I've attached the modified qvf.

 

NikosSpanos
Contributor III
Contributor III
Author

Hello @rbartley  ty for the reply. I know that separating the value in a different column will make the trick to work. But if you check my question I want both values under the same column and not separated.

Do you have any suggestion on keeping both values under the same column and still make it work?

Appreciate your time and effort.

Best regards,

Nikos

rbartley
Specialist II
Specialist II

Hi,

This is not possible using a standard Qlik Sense table since each cell is translated in HTML as a single div element and a single element can have only one style.  There might be extensions available that allow you to do this because they use a different table structure, but I'm not aware of any.

QC_DoubleColor2.GIF

NikosSpanos
Contributor III
Contributor III
Author

@rbartley  Yeah I know that the text value is unique for each cell. For this reason, I will try to manipulate the css code of the cell. If I don't succeed I will stick with the separate columns approach.

Kind regards,

Nikos