Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

Can GetFieldSelections return all possible values if no value is selected?

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!

Labels (2)
1 Solution

Accepted Solutions
marcus_sommer

You could use: concat(distinct Year, ',')

- Marcus

View solution in original post

8 Replies
marcus_sommer

You could use: concat(distinct Year, ',')

- Marcus

wanyunyang
Creator III
Creator III
Author

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.

marcus_sommer

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

wanyunyang
Creator III
Creator III
Author

I tired Sum({<Year={$(=concat(distinct Year-2, ', '))}>}Qty) this one, and it worked! Thank you!

RafaelBarrios
Partner - Specialist
Partner - Specialist

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

https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/ChartFunctions/Se...

Also remember that you can use <,<=,>,>= to search for a range of years

 

hope this helps

best,

 

Zeta
Contributor III
Contributor III

Hi,

what is the solution for Qlik Sense? There is no p() function.

Thx for help

Best regards

marcus_sommer

p() and e() are available in Sense but only within a set analysis and not as a stand-alone function.

Zeta
Contributor III
Contributor III

Thank you very much