Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
joshpinfoldold
Contributor III
Contributor III

Set Analysis Get Field Selection

Is it possible to have a set analysis which uses GetFieldSelections but if nothing is selected it includes all options. Currently have the following which returns the Feedback Volume for month before the one that is filtered. There is also a filter for division. I am wondering if I can have it default to select all because currently its returns '-' when no Division is selected.

=count({1<Feedback_Day_Start = {">=$(=monthstart(addmonths(max(Feedback_Day_Start), -1))<=$(=monthend(addmonths(max(Feedback_Day_Start), -1)))"}, Division={"$(=GetFieldSelections(Division))"}>}FeedbackFlag)

9 Replies
joshpinfoldold
Contributor III
Contributor III
Author

Is it possible to have different set modifiers for each part of the set analysis. The required {1} for the date but a {$} for the Division selection

sunny_talwar

May be try using p()

=Count({1<Feedback_Day_Start = {">=$(=MonthStart(AddMonths(Max(Feedback_Day_Start), -1))<=$(=MonthEnd(AddMonths(Max(Feedback_Day_Start), -1)))"}, Division = p(Division)>} FeedbackFlag)

joshpinfoldold
Contributor III
Contributor III
Author

Thanks for you help Sunny, I have read about p() and think that may solve it. Is the syntax correct in your example because it gives an error when I try it?

sunny_talwar

I don't see anything wrong with the syntax... have you tried clicking okay? does it give you the output you needed? If not, can you share an image of this expression in the expression editor?

joshpinfoldold
Contributor III
Contributor III
Author

Capture.PNG

Here is the expression in the editor

sunny_talwar

I think the first part of your set modifier might be the issue... try this

=Count({1<Feedback_Day_Start = {">=$(=MonthStart(AddMonths(Max(Feedback_Day_Start), -1)))<=$(=MonthEnd(AddMonths(Max(Feedback_Day_Start), -1)))"}, Division = p(Division)>} FeedbackFlag)

joshpinfoldold
Contributor III
Contributor III
Author

Ahh a missing bracket. Thanks Sunny

sunny_talwar

Is it working then?

joshpinfoldold
Contributor III
Contributor III
Author

Yes it is working as expected