Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can any one please help me.
I have one date filed in the format of '23/08/2016 06:55:60 PM' I want to display this Date in two separate columns i.e Date contains 23/08/2016 in one column and Time contains 06:55:60 PM in another column in script.
There are three steps involved:
1) Interprete your timestamp, so QV read it in as dual value
2) Transform your value, e.g. split into date (integer part of the underlying numeric value) and time (fractional part)
3) Format values as needed
LOAD
TimeStampField,
Timestamp#(TimeStampField,'DD/MM/YYYY hh:mm:ss TT') as InterpretedTimestamp,
Date(Floor(Timestamp#(TimeStampField,'DD/MM/YYYY hh:mm:ss TT')),'DD/MM/YYYY') as Date,
Time(Frac(Timestamp#(TimeStampField,'DD/MM/YYYY hh:mm:ss TT')),'hh:mm:ss TT') as Time,
...
edit:
Instead of explicitely interpreting your values, you can also use and set the default format codes in the script accordingly.
and these, copied from QlikView help
are the format code you can use to interpret and format
The same notation as that of dates and times above is used.
there's also another function to extract the date part from a timestamp:
DayName(TimestampField) as DateField
regards
Marco
Hi Swuehi,
Thank you so much.It's Working.
If your question is now answered, please flag the Correct Answer and possible Helpful Answers.
If not, please make clear what part of this question still needs answering .