Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Timestamp conversion

Morning,

I would like to convert the following date to YYYYMM but am struggling to find the right format:

31JAN2015:00:00:00

I have searched on the community but have not come across the right example. Has anyone converted this type of timestamp yet?

Thank you,

L

Tags (1)
1 Solution

Accepted Solutions

Re: Timestamp conversion

May be try this:

Date(MonthStart(Date#(Left(Trim(TimeStampField), 9), 'DDMMMYYYY')), 'YYYYMM') as TimeStampField

View solution in original post

7 Replies
balrajahlawat
Esteemed Contributor

Re: Timestamp conversion

Is it coming from Field or just this value only?

You may try like this?

=date(date#(YourField, 'NativeFormat'),'RequiredFormat')

Re: Timestamp conversion

May be try this:

Date(MonthStart(Date#(Left(Trim(TimeStampField), 9), 'DDMMMYYYY')), 'YYYYMM') as TimeStampField

View solution in original post

Re: Timestamp conversion

Hi,

Try this..

=Date(Date#('31JAN2015:00:00:00','DDMMMYYYY:hh:mm:ss'),'YYYYMM')

Re: Timestamp conversion

I would suggest using MonthStart or MonthEnd because if you don't then may be you still see YYYYMM, it would still show up as multiple entries in list box or straight table because the date can still be different. With MonthStart we will essentially making all the dates within that month equal to 1.

Re: Timestamp conversion

Thanks sunindia‌  Noted. i will keep it..

Not applicable

Re: Timestamp conversion

Thank you Sunny That worked perfectly!

Re: Timestamp conversion

Not a problem. I am glad I was able to help