Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Magogar
Contributor III
Contributor III

Graph. Filter and totalize by more than one field.

Hello.

I know it must be a very simple answer, but I can not find the solution. Can someone help me please?

I want to make a graph and I need to search the rows with the highest value in the "Period" field and return the average of the "Sales" field.

I have tried the following without success:

Avg (Max(Period) Sales)

Avg({$<Period={Max(Period)}>} Sales)

 

PeriodSales
1100
4150
2200
4100
280

 

Expected result:

PeriodSales (Avg)
4125
Labels (3)
1 Solution

Accepted Solutions
rubenmarin

Hi, can you try?:

Avg({$<Period={$(=Max(Period))}>} Sales)

 

$(=...) is converted before calculating the expression so at the end it executes:

Avg({$<Period={4}>} Sales)

View solution in original post

2 Replies
rubenmarin

Hi, can you try?:

Avg({$<Period={$(=Max(Period))}>} Sales)

 

$(=...) is converted before calculating the expression so at the end it executes:

Avg({$<Period={4}>} Sales)

Magogar
Contributor III
Contributor III
Author

Thank you very much. It works perfect!!!