Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
AO1
Contributor II
Contributor II

Text Color Expression Error

 

Hello!

I have a pivot table in Qlik that includes a Percentage column. The percentage column is calculated based on other columns in the table. 

I want this column to color code based on the returned result (above 70% should be GREEN and below should be RED). 

Below is my expression, but I am receiving an error.

Qlik Expression for Color.png
What would be the proper way to write this expression for this column? Right now, all the percentages are red, but 81.25% should be green since it is over 70%.

Productivity Percentage Column in Pivot Table.png

Any help is greatly appreciated! Thank you!

Labels (1)
1 Solution

Accepted Solutions
MatheusC
Specialist II
Specialist II

@AO1 
You use column(), as already mentioned, as in this example assuming that your column is 1, then:

if(Column(1)<'0.7',green(),blue())

From the label, you can do like:

if([Productivity Percentage]<'0.7',green(),blue())

This will return an expression error, but it can be applied in the same way.

Or using your measurement as already said.

Note: see that the percentage was assigned with a . (point) 0.7


- Regards, Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

6 Replies
Clement15
Partner - Specialist
Partner - Specialist

Hello,

In a pivot table, you can use 'Text color expression' in your measure options. For example, my current measure is Sum(LancementTotal) and my color expression is if(sum(LancementTotal)>2000,green(),red())

 

Clement15_0-1735825363897.png

 

AO1
Contributor II
Contributor II
Author

Hi-- thank you! I was using the Text Color Expression field, but I edited my expression to read as below and Qlik is no longer throwing an error, however, the numbers in the pivot table are still not showing green for anything over 70%. 

Is there a different way you would write this expression for 70%?

AO1_0-1735832849859.png

Thank you!

Clement15
Partner - Specialist
Partner - Specialist

Hello,
If your value is in percentage you must mark 0.7 and not 70

If it still does not work you can use your measure directly rather than the column() function

AO1
Contributor II
Contributor II
Author

Thank you! I changed it to 0.7, but the colors are still not showing up correctly. Can you explain how I would measure directly? What would the expression look like for that? 

Thank you so much- I so appreciate this help!

MatheusC
Specialist II
Specialist II

@AO1 
You use column(), as already mentioned, as in this example assuming that your column is 1, then:

if(Column(1)<'0.7',green(),blue())

From the label, you can do like:

if([Productivity Percentage]<'0.7',green(),blue())

This will return an expression error, but it can be applied in the same way.

Or using your measurement as already said.

Note: see that the percentage was assigned with a . (point) 0.7


- Regards, Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
AO1
Contributor II
Contributor II
Author

Thank you!! Using the column number in the expression worked!