Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

GetFieldSelections in Set Analysis

I need some help with finding an alternative go below:

= NUM(Avg({$<INSPECTION_ITEM={'Overall Satisfaction.'},
InspectionMonth = {'$(=GetFieldSelections(Month))'},InspectionYear = {'$(=GetFieldSelections(Year))'},Month={'*'},Year={'*'}>}INSPECTION_SCORE_RAW),'#.##')

Basically I am trying to have InspectionMonth be whatever the user selects in the Month field. Unfortunately the way our data works there’s so many dates, Request Date, Closed Date, Inspection Date, etc.. So I have a main calendar, and a couple other calendars to be referenced. . I opted out to having multiple month/year selectors on the page so the user doesn’t get confused. However that is causing me to go kind of crazy in some of the calculations.

All suggestions are very much appreciated,

PS,

I originally used:

= NUM(Avg({$<INSPECTION_ITEM={'Overall Satisfaction.'},

InspectionMonth = P(Month),InspectionYear = P(Year),Month={'*'},Year={'*'}>}INSPECTION_SCORE_RAW),'#.##')

But It did not calculate correctly.

3 Replies
consenit
Partner - Creator II
Partner - Creator II

Hi there.

I believe your expressions can be simplified, try:

Month=,Year=

instead of


Month={'*'},Year={'*'}

Also, take a look at the documentation for the function P() to avoid using GetFieldSelections().

Kind regards,

Ernesto.

Not applicable
Author

Unfortunately "P()" is not what I am looking for.

Essentially what I am trying to do is use another field 1 toggle, to change field 2 in set analysis.

If November is selected in Month.

I want set analysis to define 'InspectionMonth = Nov' and then include all 'Month' possibilities.

Sorry if I am wording this awfully.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression, single quotes should not be used for InspectionMonth and Year.

= NUM(Avg({$<INSPECTION_ITEM={'Overall Satisfaction.'},
InspectionMonth = {$(=GetFieldSelections(Month))},InspectionYear = {$(=GetFieldSelections(Year))},Month=,Year=>}INSPECTION_SCORE_RAW),'#.##')


Hope this helps you.


Regards,

Jagan.