Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

FirstSortedValue with an if statement or set analysis

I have an expression which correctly calculates the survey location with the highest average score (see below). Some of the survey locations have very small volumes of feedback and these are often the highest/lowest ranking locations. Is there a way of using an if statement or set analysis to remove those locations from the calculation. Any survey location with less than 10 items of feedback shouldn't be considered. Each completed survey has a feedback_id and volumes are calculated by doing a count of these unique feedback id's

=FirstSortedValue(distinct SurveyLocation, -aggr(avg(Score),SurveyLocation))

Thanks

1 Solution

Accepted Solutions
sunny_talwar

May be this

=FirstSortedValue(DISTINCT {<SurveyLocation = {"=Count(Score) >= 10"}>} SurveyLocation, -Aggr(Avg({<SurveyLocation = {"=Count(Score) >= 10"}>} Score), SurveyLocation))

View solution in original post

2 Replies
sunny_talwar

May be this

=FirstSortedValue(DISTINCT {<SurveyLocation = {"=Count(Score) >= 10"}>} SurveyLocation, -Aggr(Avg({<SurveyLocation = {"=Count(Score) >= 10"}>} Score), SurveyLocation))

Anonymous
Not applicable
Author

Thanks Sunny. Works perfectly.