Qlik Community

Qlik Sense App Development

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

joshpinfold
New 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
joshpinfold
New Contributor III

Re: Set Analysis Get Field Selection

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

MVP
MVP

Re: Set Analysis Get Field Selection

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)

joshpinfold
New Contributor III

Re: Set Analysis Get Field Selection

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?

MVP
MVP

Re: Set Analysis Get Field Selection

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?

joshpinfold
New Contributor III

Re: Set Analysis Get Field Selection

Capture.PNG

Here is the expression in the editor

MVP
MVP

Re: Set Analysis Get Field Selection

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)

joshpinfold
New Contributor III

Re: Set Analysis Get Field Selection

Ahh a missing bracket. Thanks Sunny

MVP
MVP

Re: Set Analysis Get Field Selection

Is it working then?

joshpinfold
New Contributor III

Re: Set Analysis Get Field Selection

Yes it is working as expected