Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sharatj1989
New Contributor III

how to create two separate date and time column

how to create two separate date and time column when we having date and time record in one column like (201801021700)

6 Replies
MVP
MVP

Re: how to create two separate date and time column

Try this

Date(Floor(TimeStamp#(DateTimeField, 'YYYYMMDDhhmm'))) as Date,

Time(Frac(TimeStamp#(DateTimeField, 'YYYYMMDDhhmm'))) as Time,

sharatj1989
New Contributor III

Re: how to create two separate date and time column

Yes its working.

thank you sunny talwar..

omarbensalem
Esteemed Contributor

Re: how to create two separate date and time column

date(date#(left(YourField,8),'YYYYMMDD')) as DateField,

time(time#(right(YourField,4),'hhmm'),'hh;mm') as TimeField,

omarbensalem
Esteemed Contributor

Re: how to create two separate date and time column

I think sunny's approach would be better (sorry, havn't seen it ! )

sharatj1989
New Contributor III

Re: how to create two separate date and time column

omar thanks for the answer, am beginner to qlikview both queries help me a lot.

MVP
MVP

Re: how to create two separate date and time column

I think both the approaches are the same... I don't think there is any better way... it is just a matter of preference