Qlik Community

Qlik Sense App Development

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

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

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
Highlighted

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
Highlighted

May be this

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

View solution in original post

Highlighted
Contributor III
Contributor III

Thanks Sunny. Works perfectly.