Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
AdrianCT
Contributor
Contributor

AVG MTTR only once

In Qlik I have a table like this one:

ID, MTTR, Country:

0001, 5, Spain

0001, 5, France

0001, 5, Italy

0002, 3, Argentina

0002, 3, China

0003, 5, Spain

0003, 5, Japan

0003, 5, Australia

 

If I ask for the average MTTR, the result would be: 4.5

However, I only want to count the MTTR once, so the values would be:


ID, MTTR

0001, 5

0002, 3

0003, 5

 

And the AVG MTTR would be now: 4.33

 

I want to create a expression in a report to get this last AVG MTTR

Note: I tried AVG (DISTINCT MTTR) and it didnt work, as with this formula takes 5 only once, (5+3)/2, and I want (5+3+5)/3.

Thank you!

Labels (1)
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

Hi @AdrianCT ,

Maybe this:

=avg( aggr(DISTINCT only(MTTR), ID, MTTR) )

I hope it can helps.

Best Regards

View solution in original post

2 Replies
agigliotti
Partner - Champion
Partner - Champion

Hi @AdrianCT ,

Maybe this:

=avg( aggr(DISTINCT only(MTTR), ID, MTTR) )

I hope it can helps.

Best Regards

AdrianCT
Contributor
Contributor
Author

It worked. Thank you!