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: 
davehutchinson
Contributor III
Contributor III

Colour expression help

Hi there. I'm trying to apply conditional colouring to a pivot table but my script isn't working and I can't for the life of me work out why.

 

I have a measure in my pivot table of:

=SUM(AssistantUsed)/SUM(AssistantIssueDetected)

Depending on the number I want to colour the box of the pivot table:

>0.9 Green

>0.1 Amber

<0.1 Red

The expression I've created for this is as follows.  however its not working at all, and I really don't understand why.  Can anyone spot an issue with it?

IF(SUM(SAUsed)/SUM(SAIssueDetected)>=0.90,'GoGreen',
IF(SUM(SAUsed)/SUM(SAIssueDetected)>0.11,'b6b700',
IF(SUM(SAUsed)/SUM(SADetected)>=0,'Red')
)
)

Labels (2)
1 Solution

Accepted Solutions
davehutchinson
Contributor III
Contributor III
Author

Hi all.  I eventually found the solution but wasn't as straight forward as I'd have hoped.  but this one worked in the end after trying lots of different ways!!!

 

IF(AVG({<[SmartAssistantUsed]-={0}>}[SmartAssistantUsed]/[SmartAssistantIssueDetected])<.11, Red,
IF(AVG({<[SmartAssistantUsed]-={0}>}[SmartAssistantUsed]/[SmartAssistantIssueDetected])<.90, Amber,
IF(AVG({<[SmartAssistantUsed]-={0}>}[SmartAssistantUsed]/[SmartAssistantIssueDetected])<=1.0,Green)))

 

 

View solution in original post

5 Replies
anat
Master
Master

IF(SUM(SAUsed)/SUM(SAIssueDetected)<=0.1,red(),
IF(SUM(SAUsed)/SUM(SAIssueDetected)>0.1 and SUM(SAUsed)/SUM(SAIssueDetected) <0.9,'b6b700',
IF(SUM(SAUsed)/SUM(SADetected)>=0.9,green())
)
)

Chanty4u
MVP
MVP

Try this

if(SUM(AssistantUsed)/SUM(AssistantIssueDetected) >= 0.9, 'Green',

if(SUM(AssistantUsed)/SUM(AssistantIssueDetected) > 0.1, 'Amber',

'Red'

))

qv_testing
Specialist II
Specialist II

Try this

IF(SUM(SAUsed)/SUM(SAIssueDetected)<=0.1,red(),
IF(SUM(SAUsed)/SUM(SAIssueDetected)>0.1 and SUM(SAUsed)/SUM(SAIssueDetected) <0.9,rgb(255,191,0),
IF(SUM(SAUsed)/SUM(SADetected)>=0.9,green())
)
)

davehutchinson
Contributor III
Contributor III
Author

Thanks all.  will try all these suggestions as soon as I'm able! Cheers!

davehutchinson
Contributor III
Contributor III
Author

Hi all.  I eventually found the solution but wasn't as straight forward as I'd have hoped.  but this one worked in the end after trying lots of different ways!!!

 

IF(AVG({<[SmartAssistantUsed]-={0}>}[SmartAssistantUsed]/[SmartAssistantIssueDetected])<.11, Red,
IF(AVG({<[SmartAssistantUsed]-={0}>}[SmartAssistantUsed]/[SmartAssistantIssueDetected])<.90, Amber,
IF(AVG({<[SmartAssistantUsed]-={0}>}[SmartAssistantUsed]/[SmartAssistantIssueDetected])<=1.0,Green)))