Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have one date field and data like below.
date
10-jun-2017
11-mar-2017
20-apr-2018
9-jan-2017
30-dec-2016
23-nov-2016
10-dec-2018.
The above dates not in order. I need the data in proper order like minimum to maximum dates.
23-nov-2016
30-dec-2016
9-jan-2017
11-mar-2017
10-jun-2017
20-apr-2018
10-dec-2018 like that.
How to sorting the above data. Please help on this.
Thanks
If you make sure that the date field has values that are proper dates then they will sort properly if you don't override the sorting in any way.
Check to see if the field contains the dates as actual dates and not just as textual dates. You can check that in your Data Model Viewer by looking at the tags and see if the field has the tags $date and $timestamp.
To ensure that textual dates come in as real dates you can do this in your load script:
LOAD
.....
Date( Date#( SalesDate , 'DD-MMM-YYYY' ) AS SalesDate,
......
Hi Daisy,
Please convert your date into below format and sort:
Date(Date#(date,'DD-MMM-YYYY') as Date,
Now sort this as you like.
Thanks,
Arvind Patil