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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
dana
Creator III
Creator III

Sort expression with Rank

Hi,

My table displays deviations in ascending order. 

I have a calculated DateTime dimension for the top 30.

I use the following sort expression on the DateTime dimension  based on rank:

SORT EXPRESSION.png

When the rank is equal, I would like the dates to be in ascending order. 

Any ideas how it can be done?

Thanks in advance!

 

Dev Table sort.png

Labels (1)
1 Solution

Accepted Solutions
chrismarlow
Specialist II
Specialist II

Hi,

Can you add a secondary Rank with suitable divisor to split the rank out, something like;

20201104_1.png

Cheers,

Chris.

View solution in original post

2 Replies
chrismarlow
Specialist II
Specialist II

Hi,

Can you add a secondary Rank with suitable divisor to split the rank out, something like;

20201104_1.png

Cheers,

Chris.

dana
Creator III
Creator III
Author

Great idea! Thanks!

I needed to modify the timestamp to a number in order for it to work:

Year(DateTime) & Num(Month(DateTime),'00') & Num(Day(DateTime),'00')&Num(Hour(DateTime),'00')&Num(Minute(DateTime),'00') as DateTimeNum

And the sort expression is:

Rank(Sum(Value))  + (Rank(DateTimeNum)/1000)