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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Andrea28
Contributor II
Contributor II

Greater than or equal to in set expressions

Hi I am trying to add a condition where measures (a, b, c, d, e etc) should be >=1 and field Resolution should be No errors but I am getting an error. Could anyone help check please?

The measures should have OR condition, hence the +

count({(<[a]>=1> + <[b] >=1> + <[c]>=1> + <[d] >=1> + <[e] >=1> + <[f]>=1> + <[f] >=1> + <[g] >=1> + <[h] >=1>) * <[Resolution]={'No errors'}>}[Work Unit ID])

I am probably going wrong with the syntax of the greater than= expression. Appreciate the help.

Labels (1)
4 Replies
MendyS
Partner - Creator III
Partner - Creator III

@Andrea28 

Hi, try to use that example - 

{<Resolution= {'No errors'}>} count({<[a] = {">=1"}> + <[b] = {">=1"}>} [Work Unit ID])

 

Andrea28
Contributor II
Contributor II
Author

Hi @MendyS  , the above expression is showing Garbage after expression =

Andrea28
Contributor II
Contributor II
Author

I am basically trying to count the work unit ID when either of the measures (a,b, c etc) >=1 and Resolution= {'No errors'}

vinieme12
Champion III
Champion III

A simpler way of rewriting this criteria would be just to check if the sum of all a,b,c...h is >=1

 

=count({

[Work Unit ID]={"=rangesum(alt(a,0),alt(b,0),alt(c,0),alt(d,0),alt(e,0),alt(f,0),alt(g,0),alt(h,0))>=1"}

,[Resolution]={'No errors'}

}[Work Unit ID])

 

Best would be to create a flag  field that checks this criteria during data load as below 

Tablename:

Load

a,b,c,d,e,f,g,h,workunitid

,If(rangesum(alt(a,0),alt(b,0),alt(c,0),alt(d,0),alt(e,0),alt(f,0),alt(g,0),alt(h,0))>=1,1,0) as flagfield 

From somesourcetable;

 

Then use the flagfield for simplifying the expression

 

=count({

,flagfield={1}

,[Resolution]={'No errors'}

}[Work Unit ID])

 

 

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.