Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have data loaded as NUM. It contains date. I want to convert it to date format so that I can load it into the datepicker.
Here is my data:-
I have tried these in the data load editor:-
Load
Date((Floor(Timestamp#([stamp], 'YYYY-MM-DD hh:mm:ss') ))) AS [amidate];
Date((Floor(Num#([stamp], 'YYYY-MM-DD hh:mm:ss') ))) AS [amidate];
I have set my date and time to this:
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
It still loads as Num. Can anyone suggest how to load it in Date?
Try this,
Date(Floor([stamp])) AS [amidate];
Tried. It still loads as Numeric.
Data Load script
The field stamp is loaded from the source in this format 2022-05-18 01:00:00. When I see it on qlik it is in this format:-
Your field isn't numeric else a string and the string-content is neither a date nor a time else a timestamp. This means you need to adjust the timestamp-variable to be able to interpret the content as timestamp which could be then transformed into a date like mentioned above with floor().
- Marcus
I am also having the same problem, it's the weirdest issue I have come across in qlik. I tried using date(datefield,'DD/MM/YYYY') but did not work
Try
Date(
Floor(
Timestamp#([stamp], 'M/D/YYYY h:mm:ss TT')
),
'YYYY-MM-DD hh:mm:ss') AS [amidate];
Tried this too , did not work 😞
At first load the field with text() to see the real content of it. If it's a valid number - in regard to the default-formating of numbers or dates/timestamps - a formating-function like date() could be directly applied. But if it differs to it or it are strings then an appropriate converting-function like timestamp#() is needed to get a number. Important is that the specified format-pattern fits exactly to the field-content and to the set default-formating (variables usually set at the beginning of the script - but they could be overwritten n times in the script if it's necessary).
Beside this is the statement "did not work" not really helpful ...