Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Colour

Hi ALl,

I want to set the colour and iam doing this under the expression then background

I have 4 classes .

Class A

Class B

Class C

Class D

And i want to show that if the countt of ticket for Class A and B is not equal to 0  and the Days are within 0to7 days then red else it should be Green

and if the the count of Ticket for Class A and Class B are  are greater than 5 and the days are 8 to 20 then Red else Green

if Count of ticket is above of 10 for class A and Class B for the days above 20 then it should be AMber else Green..

Iam trying to use this formula but this is not working ..

Can someone please sugget me on this

if(count({<Class={'Class A','Class B'},Days={0 -7}>}Ticket)<>0,Red(),Green())

please need help of the expertise....

Thanks in advace....

1 Solution

Accepted Solutions
Anil_Babu_Samineni

How about this?

=If(Count({<Class = {'Class A', 'Class B'}, Days = {">=0 <=7"}>} Ticket) > 0, Red(),

  If(Count({<Class = {'Class A', 'Class B'}, Days = {">=8 <=20"}>} Ticket) > 5, Red(),

  If(Count({<Class = {'Class A', 'Class B'}, Days = {">20"}>} Ticket) > 10, Blue(), Green())))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

10 Replies
Anil_Babu_Samineni

Not sure, How 0-7 is the single repository.

May be any one of these?

if(count({<Class={'Class A','Class B'},Days={'0 -7'}>}Ticket)<>0,Red(),Green()) //I assume you have direct days wither in bucket..

OR

if(count({<Class={'Class A','Class B'},Days={"=Days >=0 and Days <=7"}>}Ticket)<>0,Red(),Green())

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
smilingjohn
Specialist
Specialist
Author

Hi Anil.

SHould i use 'and' after the end of this Expression  for  8 to 20  and so on 

Anil_Babu_Samineni

Why not?

if(count({<Class={'Class A','Class B'},Days={'0 -7', '8-20'}>}Ticket)<>0,Red(),Green())

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
smilingjohn
Specialist
Specialist
Author

hi Anil ,

Please check if I am using the write expression

=if(count({<Class={'Class 1','Class 2'},Days={"=Days >=0 and Days <=7"}>}Ticket)<>0,Red(),Green()) and

if(count({<Class={'Class 1','Class 2'},Days={"=Days >7 and Days <=14"}>}Ticket)>=5,Red(),Green()) and

if(count({<Class={'Class 1','Class 2'},Days={"=Days >14 and Days <=20"}>}Ticket)>=7,Blue(),Green()) and

if(count({<Class={'Class 1','Class 2'},Days={"=Days >20"}>}Ticket)>=10,Blue(),Green())

Thanks

jonathandienst
Partner - Champion III
Partner - Champion III

Are these 3 separate colour selections? If so, then:

=If(Count({<Class = {'Class A', 'Class B'}, Days = {">=0 <=7"}>} Ticket) > 0, Red(), Green())

=If(Count({<Class = {'Class A', 'Class B'}, Days = {">=8 <=20"}>} Ticket) > 5, Red(), Green())

=If(Count({<Class = {'Class A', 'Class B'}, Days = {">20"}>} Ticket) > 10, Amber(), Green())

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

If it's one combined expression, then

=If(Count({<Class = {'Class A', 'Class B'}, Days = {">=0 <=7"}>} Ticket) > 0, Red(),

  If(Count({<Class = {'Class A', 'Class B'}, Days = {">=8 <=20"}>} Ticket) > 5, Red(),

  If(Count({<Class = {'Class A', 'Class B'}, Days = {">20"}>} Ticket) > 10, Amber(), Green())))

(Based on your original post)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anil_Babu_Samineni

How about this?

=If(Count({<Class = {'Class A', 'Class B'}, Days = {">=0 <=7"}>} Ticket) > 0, Red(),

  If(Count({<Class = {'Class A', 'Class B'}, Days = {">=8 <=20"}>} Ticket) > 5, Red(),

  If(Count({<Class = {'Class A', 'Class B'}, Days = {">20"}>} Ticket) > 10, Blue(), Green())))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
smilingjohn
Specialist
Specialist
Author

Hi Jonathan,

It is giving me the erorr of Set modifiers

smilingjohn
Specialist
Specialist
Author

Hi Anil

This works

BUt now i want to add  RGB(255,194,0), instead of blue..

it shows red mark as error