Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
isciberras
Contributor

Date time stamp conversion: YYYY/MMDD HH:MM:SS

Hi Everyone,

I'm having trouble with converting a time stamp and can't seem to find the solution to this online.

I'm have a timestamp field in the format of: YYYY/MM/DD HH:MM:SS and I would like to separate the date and time fields from this. I tried several different types of syntax to get the required answer however nothing seems to work. So far the result of trying to convert the date timestamp is Qlikview not loading in the field.

Does anyone know how I can solve this issue?

Thanks,

Isaac

1 Solution

Accepted Solutions
aronwilliamson
Contributor

Re: Date time stamp conversion: YYYY/MMDD HH:MM:SS

The below should work if all you need to do is seperate them

=Date(Date#(Left(Date,10), 'YYYY/MM/DD'), 'DD/MM/YYYY')

=Time#(right(Date,8), 'HH:MM:SS')

View solution in original post

9 Replies
aronwilliamson
Contributor

Re: Date time stamp conversion: YYYY/MMDD HH:MM:SS

Do you have an example app / data you could share so we can see how it's been setup?

Re: Date time stamp conversion: YYYY/MMDD HH:MM:SS

My guess is that you are not loading the timestamp values as a correctly formatted datetime so the data is stored in Qlik as a numeric value.

These posts should help.

Why don’t my dates work?

Get the Dates Right

Once you have the timestamp data in the correct format using time(frac([YourTimeStampField])) and date(floor([YourTimeStampField])) will separate the date and time components

Re: Date time stamp conversion: YYYY/MMDD HH:MM:SS

Hi,

try with subfield(datefield,' ',1) as date

subfield(datefield,' ',2) as time


also check timestamp#(),timestamp(),date() and date#() in help menu


syntax and explanation is available in help


Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.
aronwilliamson
Contributor

Re: Date time stamp conversion: YYYY/MMDD HH:MM:SS

The below should work if all you need to do is seperate them

=Date(Date#(Left(Date,10), 'YYYY/MM/DD'), 'DD/MM/YYYY')

=Time#(right(Date,8), 'HH:MM:SS')

View solution in original post

sergio0592
Valued Contributor II

Re: Date time stamp conversion: YYYY/MMDD HH:MM:SS

Try with:

Date_filed=Date#(left(Timestamp_field,10),'YYYYMMDD')

Time_field=Time#(right(Timestamp_field ,8),'HH:MM:SS')

After, you can format them with Date and Time function.

isciberras
Contributor

Re: Date time stamp conversion: YYYY/MMDD HH:MM:SS

Tried everything and took ages, but this worked perfectly thank you so much

isciberras
Contributor

Re: Date time stamp conversion: YYYY/MMDD HH:MM:SS

Thank you for your help

isciberras
Contributor

Re: Date time stamp conversion: YYYY/MMDD HH:MM:SS

Thank you for your help

isciberras
Contributor

Re: Date time stamp conversion: YYYY/MMDD HH:MM:SS

Thank you for your help