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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with <= >= syntax please

Hi,

The following works well:

=sum(aggr(DISTINCT If(Sum({<[Year]={$(vCurrentYear)}>} [Hours Worked]*if(IsNull(Rate), 20, Rate))>=1000, 1, 0),[Billing code]))

where I'm effectively counting the number of Billing Codes this year that have more than £1000 worth of time recorded against them.

what I'd like to do, but can't figure out the syntax is to count the number of Billing Codes between two values.

So, instead of greater than or equal to 1000 (as above) I want to do something like >=1000 <=2000

Any help would be appreciated.

Thanks

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try this:

=sum(aggr(DISTINCT If(Sum({<[Year]={$(vCurrentYear)}>} [Hours Worked]*if(IsNull(Rate), 20, Rate))>=1000 AND Sum({<[Year]={$(vCurrentYear)}>} [Hours Worked]*if(IsNull(Rate), 20, Rate))<=2000, 1, 0),[Billing code]))

View solution in original post

2 Replies
tresesco
MVP
MVP

Try this:

=sum(aggr(DISTINCT If(Sum({<[Year]={$(vCurrentYear)}>} [Hours Worked]*if(IsNull(Rate), 20, Rate))>=1000 AND Sum({<[Year]={$(vCurrentYear)}>} [Hours Worked]*if(IsNull(Rate), 20, Rate))<=2000, 1, 0),[Billing code]))

Not applicable
Author

Perfect, thanks