Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

RE:what wrong in my expression?

Hi all,

=Count({[Def_Severity]<='1-Critical'>Def_Id)

What wrng in dis exp?

any suggestions

13 Replies
Anonymous
Not applicable

try this

=Count({[Def_Severity]={'<=$(1-Critical')}>Def_Id)

Kushal_Chawda

try

Count({<[Def_Severity]={'1-Critical'}>}Def_Id)

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Well, this is simple. Set modifiers are assignments, not comparisons. On the left, you specify a field name (no expressions, just a field name), then comes the assignment operator and then comes the set of values between curly braces you want to assign to that field

If you want to express the set of values as an expression ("all values smaller than or equal to"), you have to enter a search string between the curly braces. Rudolf did exactly that in correcting your example.

However, I don't exactly see what you mean by the comparison <= '1-Ciritcal'. Do you want to create set with all values that are smaller than or equal to 1 minus the value of field Critical? If not, then please specify what the values are that Def_Severity (square brackets aren't needed here) can have.

Chanty4u
MVP
MVP
Author

hi kush,

i hve other filter lik

DEF_Aging

>3days

1day

2day

3day

but i need to disaply the colurs  in same text object

=Count({<[Def_Severity]={'1-Critical'}>}Def_ID)   in dis  expression only

Median Value:
For Critical Defects :   < 0.5 days - green, > 0.5 days to 1 day Yellow, > 1 day RED

For Major Defects :   < 1.5 days - green, > 1.5 days to 3 days Yellow, > 3 days RED

Chanty4u
MVP
MVP
Author

hi kush,

='Critical:-'&Count({<[Def_Severity]={'1-Critical'}>}Def_ID) and

  if(count(Def_Severity)<=0.5, Red())

i hve tried bur expression sayng ok..but value colur nt chnging

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You'll have to add the same set analysis in the second count as well, if you want to color a value relaled to '1-Ciritcal'. For example, add this to the Background Color expression:

=IF (Median({<[Def_Severity]={'1-Critical'}>} Defect_Aging_Days)<=0.5, Green(),

     IF (Median({<[Def_Severity]={'1-Critical'}>} Defect_Aging_Days) > , Red(),

         Yellow()))


Best,


Peter


[Edit] Modified to include correct field name from post below.

sunny_talwar

Can you share some data to help you better here?

Chanty4u
MVP
MVP
Author

could u help sunny on this exp

='Critical:-'&Count({<[Def_Severity]={'1-Critical'}>}Def_ID) and

  if(count(Defect_Aging_Days)<=0.5, Red())

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Hmm, a count that returns 0.5? 0.4? 0.6 maybe?