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: 
shaunj12
Contributor
Contributor

Sort by Calculated Dimensions

Hi,

I have a Straight Table with two columns: "Received Date" (Calculated Dimension) and "# Orders" (Expression) and I am formatting the Received Date column as 'Mon-YYYY', and also splitting the current month into weeks (eg Week 1, Week 2, etc.).


My Received Date Calculated Dimension is:

=If(Month(Today())=Month(C_RECEIVED_DATE) and Year(Today())=Year(C_RECEIVED_DATE),

'Week ' & Ceil(Day(C_RECEIVED_DATE)/7),Month(C_RECEIVED_DATE) & '-' & Year(C_RECEIVED_DATE))



I want the Received Date column to sort in chronological order like below:


CorrectSort.jpg

But it is sorting like this:

IncorrectSort.jpg

I've attached a simple qvw with my issue.

Regards,

Shaun

1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

Hi,

on the sorting table, uncheck everything and use this expression on the MonthWeek field:

=max(C_RECEIVED_DATE) //on ascending

PFA

View solution in original post

2 Replies
YoussefBelloum
Champion
Champion

Hi,

on the sorting table, uncheck everything and use this expression on the MonthWeek field:

=max(C_RECEIVED_DATE) //on ascending

PFA

shaunj12
Contributor
Contributor
Author

Wow, that was easy -- now I feel a little silly.  I was trying to use the expression to sort but I was getting way to complicated with what I was trying.

Thank you very much Youssef!