Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a straight table and need to sort it as per a column which is Date/time format. I have below expression in the
Chart Properties -> Sort
=Date(Scheduled_Start_date,'dd/mm/yyyy hh:mm:ss')
And also promoted the column to the top but i am not seeing the right results.
Resulting output
I am seeing 2 rows from 2019 on the top.
I am looking to sort this in the descending order of time
i.e 2020
It looks like your date field is not in proper timestamp format. Set the timestamp variable in script like below
SET TimestampFormat='MM/DD/YYYY h:mm:ss TT';
Note: Set the format of above variable based on the format of the field coming from source. For eg. Scheduled_Start_date values from source is '01/23/2019 04:01:33 AM' then set the variable format as above.
Now in script you can format the Scheduled_Start_date using timestamp function
LOAD *,
timestamp(Scheduled_Start_date,'DD/MM/YYYY hh:mm:ss TT') as Scheduled_Start_date
FROM Source;
Now, in chart you can simply sort this field Numerically ascending or descending
It looks like your date field is not in proper timestamp format. Set the timestamp variable in script like below
SET TimestampFormat='MM/DD/YYYY h:mm:ss TT';
Note: Set the format of above variable based on the format of the field coming from source. For eg. Scheduled_Start_date values from source is '01/23/2019 04:01:33 AM' then set the variable format as above.
Now in script you can format the Scheduled_Start_date using timestamp function
LOAD *,
timestamp(Scheduled_Start_date,'DD/MM/YYYY hh:mm:ss TT') as Scheduled_Start_date
FROM Source;
Now, in chart you can simply sort this field Numerically ascending or descending