Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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 (2)
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!!!