Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ca3868077
Contributor II
Contributor II

Greater than and Less than - Set Analysis Expression using a Measure

Hello,

 

I'm trying to write a set analysis expression that counts the number of [Items] where the value of a measure [Fill %] is greater than 0 and less than 25.

I've written the formula several different ways, but no success, the results are incorrect:

 

Count({<[Fill %]={">0 <25"}>}Items)

Count({$<[Fill %] > {'0'}, [Fill %] < {'25'}>} Items)

Count({$<[Fill %] = {'>0'}, [Fill %] ={'<25'}>} Items)

 

None of the above work.  Any ideas or suggestions are greatly appreciated!

Labels (1)
1 Solution

Accepted Solutions
vincent_ardiet_
Specialist
Specialist

Yes you can't use a measure like this.
I guess this is a master item? 
In this case, this should be better :  Count({<Items={"=[Fill %]>0 And [Fill %]<25"}>}Items)
By the way if this is returning a percentage, 0.25 is maybe the upper boundary.

View solution in original post

5 Replies
Mark_Little
Luminary
Luminary

Hi,

your first set analysis is what i would have expected. Have you tired just great than and less than on there own to see if they are returning values as expected.

 

 

ca3868077
Contributor II
Contributor II
Author

Thank you for your response.  I have tried it with one at a time and no change.   In fact, no matter which version I use, it displays the same number as the result.

Could the issue be that my measure, [Fill %], is a measure and not a column field?

vincent_ardiet_
Specialist
Specialist

Yes you can't use a measure like this.
I guess this is a master item? 
In this case, this should be better :  Count({<Items={"=[Fill %]>0 And [Fill %]<25"}>}Items)
By the way if this is returning a percentage, 0.25 is maybe the upper boundary.

sbaro_bd
Creator
Creator

Hello @ca3868077 ,

Only the first one has a good synthax. It doesn't work because the Set analysis work like a filter on dimension, not on aggregated measure (on front-end part). Try an expression like and tell us if it works :

Count({<[Items]={"=Fill_calculation_expression > 0"}> * <[Items]={"=Fill_calculation_expression < 25"}>}Items)

Regards.

 

ca3868077
Contributor II
Contributor II
Author

Thank you.  Your formula and syntax seem to produce a result that is possible.  Also, yes it is a master item measure and I've used 0.25 as the upper bounds.

 

I appreciate your help.  And thank you to everyone who responded with suggestions.