Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have Year 2022, 2021, 2020. GetFieldSelections can give me the years I select, but if I don't select anything, it returns null.
I wonder if there is a formula to show all years if no years are selected.
Thanks in advance!
You could use: concat(distinct Year, ',')
- Marcus
Hi Marcus,
Thank you for your help! Is it possible to use this function in set analysis? I tried Sum({<Year={"$(=concat(distinct Year-2, ', '))"}>}Qty), but it returned null value.
Are there any possible year-values - existing ones in regard to -2 respectively to the made selections? Another point is the syntax which isn't quite right by multiple values - in this case it should look like:
Sum({<Year={$(=concat(distinct Year-2, ', '))}>}Qty)
If it's not working put the concat(distinct Year-2, ', ') directly as parallel expression within a table-chart to see the results which should then give valuable hints what happens.
- Marcus
I tired Sum({<Year={$(=concat(distinct Year-2, ', '))}>}Qty) this one, and it worked! Thank you!
Hi @wanyunyang
Just a tip
for small list of possible and only numeric values that will do the trick, but for bigger list will have an important impact in performance.
And that’s what possible values p() are for
Also remember that you can use <,<=,>,>= to search for a range of years
hope this helps
best,
Hi,
what is the solution for Qlik Sense? There is no p() function.
Thx for help
Best regards
p() and e() are available in Sense but only within a set analysis and not as a stand-alone function.
Thank you very much