Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sort by date with a slider object?

Hi guys,

I have a slider object which has dates on the scale in the format 'DD-MM-YYYY'.

The dates currently appear out of order and I am trying to make them appear chronologically.  I have gone into properties -> sort and from there I have tried sorting by using individually all the check boxes.  I have tried (in the 'Expression' field) using the day(...) function and tried formatting it using date( date#(...) ), before trying to sort numerically, but this doesn't work

I have researched on this forum but I couldn't find an answer, so if you guys know please let me know.

Best regards.

15 Replies
Anonymous
Not applicable
Author

Looks like it is QlikView, not Qlik Sense. Wrong forum.

Anyway, the problem is that the date here is in fact text, not a valid date.  The best way to deal with it is in the script:

LOAD

date(date#([Date due],'DD-MM-YYYY')) as [Date due]

Edit:

Sort on the front end works for me too, if sort by expression,ascending:

date(date#([Date due],'DD-MM-YYYY'))


Still, I recommend on the script level

Not applicable
Author

I'm following your example, but I must have my slider set up wrong because, the dates don't appear sorted.

I moved my slider up and down but as you can see, the first date shown is in 2018, then 2019 then 2015.

Not applicable
Author

Yep.  Had a dumb moment and put this in the wrong forum.

Not applicable
Author

I tried this expression previously with numeric box checked and then text box check in the sort tab, but I get this:

The date goes from 2018, 2019, 2015...

Is there something else in another tab I'm supposed to do?

sunny_talwar

Remove the numeric sort and see if that helps? Did you check the sample I attached? That have correct sorting right?

Anonymous
Not applicable
Author

See attached.  It is your file with the sort by expression added.

(Again - it is better to do it in the script)