Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Help: how to separate date and time

Hello Qlivers,

     if I want to serarate date and time from a colume contained both date and time together. how do i do it??

thank you~~

This is a sample of the date colume.

qlikview.PNG

none of the codes were actually not working,

but i actually figured out how to do it, Anyways guys, for future reference, here is what i have::

Date(date#(date(Floor(departure), 'DD/MM/YYYY'), 'MM/DD/YYYY'), 'MM/DD/YYYY') as OutputDate,

Timestamp(arrive-Floor(departure), 'hh:mm') as OutputTime;

5 Replies
Gabriel
Valued Contributor III

Re: Help: how to separate date and time

Hi,

Give that there's no visual of teh Date & Time format from your data.

Try Date(Subfield(xxxx,1) as date

      Time (Subfield(xxxx) as Time

It that didn't work then upload sample data.

Regards,

Gabriel

Not applicable

Re: Help: how to separate date and time

Hi Gabriel, here is what my date look like.

qlikview.PNG

mwoolf
Honored Contributor II

Re: Help: how to separate date and time

If your field is named MyField:

date(floor(MyField) as MyDate,

timestamp(MyField-floor(MyField) as MyTime,

Gabriel
Valued Contributor III

Re: Help: how to separate date and time

Hi,

Try this code using LIST BOX

Right click anywhere in the sheet then New Sheet Object -> List Box -> Field pane select Expression -> then enter

=date(SubField(DateTime,' ',1)) click ok.

This will give you just the Date

Right click anywhere in the sheet then New Sheet Object -> List Box -> Field pane select Expression -> then enter

=time(SubField(DateTime,' ',2)) click ok.

This gives you the time part.

This works for me so it should work.

Regards,

Gabriel

Re: Help: how to separate date and time

Hi,

You Can create fileds like below

Date(Floor(DateTimeField)) As DateField

Time(Frac(DateTimeField)) AS TimeField

Hope it helps

Celambarasan