Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I bug showed up in our application that I thought was a little weird. Let's say that we have the following two tables:
Table A:
KEY | YEAR |
1 | 2022 |
Table B (empty):
KEY | NAME |
In this app I have a listbox which generates a list of the years available for records with a certain name in Table B. Its expression is:
=aggr(only({1<B.NAME = {'Foo'}>} DISTINCT A.YEAR), A.YEAR)
Normally this works fine, but when Table B is empty it results in "2022". I would expect it to result in NULL. Just using only returns the same:
=only({1<B.NAME = {'Foo'}>} DISTINCT A.YEAR)
Just wondering why this happens and if there is an easy way around it other than using an if statement.
It's not a bug else an intended behaviour respectively a side-effect. Set analysis evaluates the selection states of TRUE or FALSE which aren't available by NULL. Therefore these statements will be ignored (also if there is a none existing field specified). Of course Qlik might have been implemented any additionally logic before the evaluation to fetch such scenarios but it adds an overhead and they decided against it to speed up the performance.
- Marcus
Pl check what do you see with below modification
=aggr(only({1<A.YEAR = P({<B.NAME={'Foo'}>})>} DISTINCT A.YEAR), A.YEAR)
s
It's not a bug else an intended behaviour respectively a side-effect. Set analysis evaluates the selection states of TRUE or FALSE which aren't available by NULL. Therefore these statements will be ignored (also if there is a none existing field specified). Of course Qlik might have been implemented any additionally logic before the evaluation to fetch such scenarios but it adds an overhead and they decided against it to speed up the performance.
- Marcus
I get the same behavior unfortunately.
Gotcha. Thanks for confirming this!