Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Separating date and time from the field ?

Hello ,

  I'm have a field in this format  1/1/2012 7:15:54PM   ie MM//DD/YYY HH:MM:SS .i"m using Qlikview 11 version.

    I want to separate date and time component . How can this be done.

Attaching an example qvw

Thanks

B

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Use the floor and frac functions to split the datetime in date and time parts:

Date_field:

LOAD

Date_time,

floor(Date_time) as Date,

frac(Date_time) as Time

FROM

\\Falconetwork\dsteam$\_Swarup\Camp\date_time.xls

(biff, embedded labels, table is Sheet1$);


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Use the floor and frac functions to split the datetime in date and time parts:

Date_field:

LOAD

Date_time,

floor(Date_time) as Date,

frac(Date_time) as Time

FROM

\\Falconetwork\dsteam$\_Swarup\Camp\date_time.xls

(biff, embedded labels, table is Sheet1$);


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi Prabhu,

Date_field:

LOAD Date_Time,

          Date(Timestamp#(@1,'MM/DD/YYYY hh:mm:ss TT'),'DD-MM-YYYY')   AS Date,

          Time(Timestamp#(@1,'MM/DD/YYYY hh:mm:ss TT'),'DD-MM-YYYY')   AS Time

From

\\Falconetwork\dsteam$\_Swarup\Camp\date_time.xls

(biff, embedded labels, table is Sheet1$);

above script is usefull for seperating  date and time.

Regards

Anonymous
Not applicable
Author

Thank you guys

B

Anonymous
Not applicable
Author

Hi Prabhu,

   Above mentioned floor and frac functions also useful but in frent of those script add date for date and time function for time.

Date_field:

LOAD

Date_time,

DATE(floor(Date_time),'DD-MM-YYYY') as Date,

time(frac(Date_time),'hh:mm:ss') as Time

FROM \\Falconetwork\dsteam$\_Swarup\Camp\date_time.xls(biff, embedded labels, table is Sheet1$);ds

Rgards