Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am new to Qlik and experiencing problems with sorting my date columns.
I have 2 date columns - MonthsSTR and YearsSTR
The values for the MonthsSTR one are : Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.
The values for the YearSTR one are: 2019,2020,2021,2022
The auto sort is sorting them quite bad so I tried some wildmatch() functions and match() functions without much success.
Can anyone provide guidance or a solution for this?
Any help is appreciated
Try using month number
num(MONTH(Date(SHPD_DT)))
Hello,
The output that i am getting is something like this:
or this :
or this - depending on selection from the date range picker:
Cannot really find a pattern on how it arranges them as they sort of work at times and then they do not depending on selection. Often dont even get the same result with the same selection i have done a few selections in between the one that i am aiming to get the same results.
Hello,
Did try your suggestion. This did not affect the sorting in any way.
I am assuming this needs to go in the sorting section when i sort by expression and not in the data section where my dimension is ? correct?
Hi @Wint3rSt0rm ,
I assume that your Year dimension is sorting properly. Only issue is with months.
Try below sorting expression in "sort by expression" option of your month dimension:
pick(match(MonthsSTR,'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'))
Also make sure other sorting options for month are unchecked.
Regards,
Aditya