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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
amaaiia
Contributor III
Contributor III

How to get de max date of a month in a pivot table column

Hello,

I have the following data:

date1 month1 (as calculated month(date1)) dim1 value1
2022-05-01 may-2022 a 5
2022-05-02 may-2022 b 2
... ... ... ...
2022-08-31 aug-2022 a 8

I want to create a Pivot Table visualizacion where I have Dim1 as row, and month1 as column. The measure has to show the max(date1) loaded avg measure of value1 for each month1.

With this measure: max(date1), I get the last loaded date for each month, but when I try to get the avg measure of this date1 it doesn't work: avg({<date1={"$(=max(date1)))"}>} value1)

When max(date1) is inside set analysis, it calculates de max date of all the data, not for the month.

1 Solution

Accepted Solutions
brunobertels
Master
Master

hi 

may be aggr your mesure like this 

aggr(avg({<date1={"$(=max(date1)))"}>} value1),Month1,Dim1)

View solution in original post

1 Reply
brunobertels
Master
Master

hi 

may be aggr your mesure like this 

aggr(avg({<date1={"$(=max(date1)))"}>} value1),Month1,Dim1)