Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Marlen
Contributor
Contributor

Sorting in a pivot table by last column

Hello again.

I'm trying to sort my pivot table by last column (desc). Columns as monthes:

Marlen_0-1612952960803.png

count({<[MonthFiled]={$(=max([MonthFiled]))}>} 1)

in sort by expression

but it's incorrect. [MonthFiled] is numeric - first date of each month.

What am I doing wrong?

1 Reply
morgankejerhag
Partner - Creator III
Partner - Creator III

If MonthFiled is a date you will have a problem comparing the value with max in set analysis. This is due to that max() will return the integer form of the date (45324) while the comparison is made with the text 2021-02-13. You need to change the value to date after the max.

count({<[MonthFiled]={$(=date(max([MonthFiled]),'YYYY-MM-DD'))}>} 1)

The format of the date needs to match the format of MonthFiles.

Morgan Kejerhag
Senior Business Intelligence Consultant
Drake Analytics
http://www.drakeanalytics.se