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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
ddd111rgg23
Contributor III
Contributor III

Change a string to Date format

hello 

 

i have date format as the below screenshot and i try to convert it to dd-mm-yyyy , but it show no date when i use the following expression  :

Date(Date#(TRANSACTION_DATE, 'YYYY-MM-DD hh:mm:ss'), 'DD/MM/YYYY') AS Master_Calendar_Date_Num

dosaril_0-1738684901137.png

thanks 

 

4 Replies
marcus_sommer

It seems to be already interpreted as date and therefore the following should be enough:

Date(TRANSACTION_DATE, 'DD/MM/YYYY')

SRA
Partner - Creator
Partner - Creator

Hi,

Your TRANSACTION_DATE contains milliseconds, so I would use :

Date(Date#(TRANSACTION_DATE, 'YYYY-MM-DD hh:mm:ss.ms'), 'DD/MM/YYYY') AS Master_Calendar_Date_Num

Regards

 

andydietler
Partner - Creator
Partner - Creator

What you have is a timestamp. You can format it to look like a date but the underlying number is going to be a timestamp so it won't function like a dimension. What I would do first is remove the time portion using floor().

So something like Date(Floor(TRANSACTION_DATE), 'DD/MM/YYYY') AS Master_Calendar_Date_Num

Bhushan_Mahajan
Creator II
Creator II

@ddd111rgg23 It is already a date, there is no need to use Date#. Use Date(floor(TRANSACTION_DATE), 'DD/MM/YYYY')