Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am new to Qlikview and hope to get some guidance.
I have a dimension datetime that looks like this:
Format:DD/MM/YYYY HH:MM
8/17/2015 7:05
15/17/2015 19:05
How could I extract the date DD/MM/YYYY from it?
15/17/2015? What kind of date is this? Typo? May be try this
Date(Floor(TimeStamp#(DateField, 'DD/MM/YYYY hh:mm')), 'DD/MM/YYYY') as Date
Hi try this
a:
LOAD * Inline
[
Dates
8/17/2015 7:05
12/17/2015 19:05
];
Result:
load *,
Date(Date#(Dates,'M/DD/YYYY hh:mm'),'DD/MM/YYYY') as NewDate
Resident a;
Hi chanty4u,
I tried your method and it works great. Thanks for helping.
Apologies, i made a typo in the 2nd date. Thanks for your help Sunny.
I would suggest you not to use this without a Floor function.... because if you don't add Floor, the date might look like just the date, but the underlying value is still a timestamp. What that means is that if you have more than one timestamp for a single day, those will repeat in the list box.... Use this
Date(Floor(TimeStamp#(DateField, 'DD/MM/YYYY hh:mm')), 'DD/MM/YYYY') as Date
or this based on your timestamp format
Date(Floor(TimeStamp#(DateField, 'M/D/YYYY hh:mm')), 'DD/MM/YYYY') as Date
Agree with Sunny. I think you can also use the DayStart function.
Or even DayName()