Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Anonymous
Not applicable
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)

Anonymous
Not applicable
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?

Anonymous
Not applicable
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)

Anonymous
Not applicable
Author

Ahh a missing bracket. Thanks Sunny

sunny_talwar

Is it working then?

Anonymous
Not applicable
Author

Yes it is working as expected