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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
1600eads
Contributor III
Contributor III

Sort column values (dates) by desc

I am having issues doing the normal sorting desc. 

1600eads_0-1736870112133.png

I have this date field, where the '-' is an actual value we need to display as this denotes that this user is in queue. When I try to sort by desc, I expected to see latest date values at the top but it is not changing accordingly. Any ideas on this behavior? 

Labels (3)
2 Replies
sbaro_bd
Creator III
Creator III

Hi @1600eads ,

It's normal when you're applying a descending sort on a column with a symbol. Two solutions : 

  • Clear all '-' symbols when you load your data.
  • Or define this statement in your script SET NullInterpret = '-';.It will help you to interpret dash like a NULL value.

Try it and tell us if it works.

Regards.

Chanty4u
MVP
MVP

Try this 

LOAD 

    If([Date Field] = '-', Null(), Date#([Date Field], 'DD/MM/YYYY')) AS Date_Sorted,

    [Date Field];

Use this Date_Sorted field in your sorting options