Qlik Community

Qlik Sense App Development

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

joshpinfold
New 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
MVP
MVP

Re: FirstSortedValue with an if statement or set analysis

May be this

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

2 Replies
MVP
MVP

Re: FirstSortedValue with an if statement or set analysis

May be this

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

joshpinfold
New Contributor III

Re: FirstSortedValue with an if statement or set analysis

Thanks Sunny. Works perfectly.