Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
YReisner
Contributor
Contributor

find best dimension by metric from a filtered dimension list

Hi everyone! 

First time asking a question 🙂 

We have some kind of feedback screen, and I want to create a KPI view of the language with the highest good feedback rate. However, I only want to include languages where we have a minimum number of feedbacks. 

I managed without the filter to get to this:
FirstSortedValue(language, -Aggr(Count({<speed_feedback = {'good'}>}distinct email)/count({<first -= '-'>} distinct email), language))

Which works, but I can't seem to manage to create a filter by language count for example. Something like count(language) > 50 
as an example. 

Thanks for helping out!

1 Solution

Accepted Solutions
Or
MVP
MVP

A bit hard to write it out perfectly without access to your data, but using a bit of random inline data:

Load * INLINE [
A, B
A, 1
A, 2
A, 3
B, 9
C, 2
C, 5
];

Formula:

FirstSortedValue(A, if(Aggr(Count(B),A)>1,-Aggr(Avg(B), A)))

 

In this example, it should pick out the A with the highest average B, but only for values of A with at least two rows. Hopefully you can adapt this to your actual situation.

View solution in original post

2 Replies
Or
MVP
MVP

A bit hard to write it out perfectly without access to your data, but using a bit of random inline data:

Load * INLINE [
A, B
A, 1
A, 2
A, 3
B, 9
C, 2
C, 5
];

Formula:

FirstSortedValue(A, if(Aggr(Count(B),A)>1,-Aggr(Avg(B), A)))

 

In this example, it should pick out the A with the highest average B, but only for values of A with at least two rows. Hopefully you can adapt this to your actual situation.

YReisner
Contributor
Contributor
Author

It worked! You understood perfectly 🙂 

Thank you very much!