Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
pankaj286
Contributor
Contributor

How to use one expression inside another expression in Set Expression

Hi,

How can i use one expression inside another expression in Set expression. I want to count of model numbers where average rating of a model number should be greater than 3? We have multiple rating for one model number, we take average of all those rating. Please let me know if need any other detail.

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Count({<ModelNumber = {"=Avg(Rating)>3"}>} Distinct ModelNumber)

 

View solution in original post

3 Replies
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @pankaj286 based on your description, it could be something like this:

Count({<Rating = {"=Avg(Rating)>3"}>} Distinct ModelNumber)

But if you send same sample data with the exact problem you have, it could be easier to have a response.

JG

pankaj286
Contributor
Contributor
Author

Thanks  JG.

To explain my query i am putting a snapshot of the sample data. In below snapshot  i have 4 models and their rating. If you take average of rating of each model, only the last model have average rating greater than 3. So i am expecting result.

Model with average rating>3/Total model, 

so in this case: 1/4=25%

pankaj286_0-1632724520998.png

I hope this should clear the requirement. Please let me know if need any other detail.

tresesco
MVP
MVP

Try like:

Count({<ModelNumber = {"=Avg(Rating)>3"}>} Distinct ModelNumber)