Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm using set analyis to select a range of numbers in a column.
e.g. with the data:
dimension | measure |
---|---|
1 | 1 |
2 | 1 |
3 | 1 |
4 | 1 |
5 | 1 |
sum(measure) = 5
sum({$<dimension={">2"}>}measure) = 3
sum({$<dimension={">2<=4"}>}measure) = 2
... so far so good ...
I am finding that sum({$<dimension={">5<=5"}>}measure) returns 5, not 0, which doesn't make any sense to me logically.
sum({$<dimension={">5"}*{"<=5"}>}measure) returns 0 as expected.
Before considering this bug territory I wanted to check whether anyone has encountered this before? Am I missing something obvious here?
I see the same behaviour in both Qlik Sense and Qlik View
Cheers,
Dominic
Probably a case where an AND is turned into an OR because the AND doesn't return anything. If you use <=3>=5 you'll get everything that's not between 3 and 5. That's because an OR would give you and empty set. If you use >=3<=5 an AND is used because otherwise you get an empty set. So, my guess is that >5<=5 also uses an OR because and AND will give you an empty set. And if you want to be silly and actually want an empty set you should do what you did in your last expression.
Probably a case where an AND is turned into an OR because the AND doesn't return anything. If you use <=3>=5 you'll get everything that's not between 3 and 5. That's because an OR would give you and empty set. If you use >=3<=5 an AND is used because otherwise you get an empty set. So, my guess is that >5<=5 also uses an OR because and AND will give you an empty set. And if you want to be silly and actually want an empty set you should do what you did in your last expression.
Yes, I believe Gysbert is again right, there was a similar discussion few days ago.
OK, I guess I can understand that though it feels a bit arbitrary and inconsistent to reverse operator depending on whether a result is returned or not.
The use case here is that I want to create set modifiers for year-to-date and year-to-go ... If you select the final period of the year then the year-to-go set modifier should indeed return an empty set, because year-to-date = full year. Not sure that's silly but maybe there's a better way to achieve this than my suggestion?