Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
David_K
Contributor III
Contributor III

Colour Coded Sum Results

Hi fellow Qlik Sense Users,

I have a a calculated field based on a sum that returns a percentage as the result.

(Count({<CLASSIFICATION={'CASES RATED B-G'}>} CLASSIFICATION)/count(CASE_ID)

This works perfectly in giving the correct percentage as the answer.  However, I am stuck in trying to work out how I can colour code the answer.

If the answer is:

>=25% RED

>=12.5%, <25% YELLOW

<12.5% GREEN.

 

I have tried using IF.... but the answer is complete gibberish.

Can any one please provide some input into how I can resolve this problem I am having.

Many thanks in advance,

David 

 

 

 

 

Labels (5)
3 Solutions

Accepted Solutions
MatheusC
Specialist
Specialist

Hey,
 
try it this way
 
I hope it helps
 
if(
(Count({<CLASSIFICATION={'CASES RATED BG'}>} CLASSIFICATION)
/
count(CASE_ID)>=0.25,'red',
if(
 
(Count({<CLASSIFICATION={'CASES RATED BG'}>} CLASSIFICATION)
/
count(CASE_ID)>=0.125,'yellow',
if(
 
(Count({<CLASSIFICATION={'CASES RATED BG'}>} CLASSIFICATION)
/
count(CASE_ID)<0.125,'yellow','green')))
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

cristianj23a
Partner - Creator III
Partner - Creator III

Hello, this is the code:

IF(
Count({<CLASSIFICATION={'CASES RATED B-G'}>} CLASSIFICATION) / Count(CASE_ID) >= 0.25,
RGB(255, 0, 0), // Red
IF(
Count({<CLASSIFICATION={'CASES RATED B-G'}>} CLASSIFICATION) / Count(CASE_ID) >= 0.125,
RGB(255, 255, 0), // Yellow
RGB(0, 255, 0) // Green
)
)

 

Regarts.

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.

View solution in original post

David_K
Contributor III
Contributor III
Author

Hi cristianj23a,

Thanks for your reply.

I have applied your recommendation, and unfortunately the answer provided is the same as I have before  (4294967040)

The numbers I have are 20 (cases rated b-g) / 105 (count(case_ID)) = 0.1904  (19.04%)

This result would then be displayed YELLOW

do you have any further suggestions?

 

Many thanks in advance

View solution in original post

3 Replies
MatheusC
Specialist
Specialist

Hey,
 
try it this way
 
I hope it helps
 
if(
(Count({<CLASSIFICATION={'CASES RATED BG'}>} CLASSIFICATION)
/
count(CASE_ID)>=0.25,'red',
if(
 
(Count({<CLASSIFICATION={'CASES RATED BG'}>} CLASSIFICATION)
/
count(CASE_ID)>=0.125,'yellow',
if(
 
(Count({<CLASSIFICATION={'CASES RATED BG'}>} CLASSIFICATION)
/
count(CASE_ID)<0.125,'yellow','green')))
Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
cristianj23a
Partner - Creator III
Partner - Creator III

Hello, this is the code:

IF(
Count({<CLASSIFICATION={'CASES RATED B-G'}>} CLASSIFICATION) / Count(CASE_ID) >= 0.25,
RGB(255, 0, 0), // Red
IF(
Count({<CLASSIFICATION={'CASES RATED B-G'}>} CLASSIFICATION) / Count(CASE_ID) >= 0.125,
RGB(255, 255, 0), // Yellow
RGB(0, 255, 0) // Green
)
)

 

Regarts.

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
David_K
Contributor III
Contributor III
Author

Hi cristianj23a,

Thanks for your reply.

I have applied your recommendation, and unfortunately the answer provided is the same as I have before  (4294967040)

The numbers I have are 20 (cases rated b-g) / 105 (count(case_ID)) = 0.1904  (19.04%)

This result would then be displayed YELLOW

do you have any further suggestions?

 

Many thanks in advance