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: 
Not applicable

How to split time and date?

This is the format I have. Now I want to split into Year, Month Year, Date, Week, Month and Time.

Can anyone help me out please.

Capture.JPG.jpg

1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

If you have perfect timestamp filed then use

Date(DateField) as NewDateColumn,

Year(DateField) as Year,

Month(DateField) as Month,

MonthName(DateField) as MonthYear,

Week(DateField) as Week,

Time(DateField) as Time

View solution in original post

5 Replies
venkatg6759
Creator III
Creator III

For

Year use

Year(Fieldname)

MonthYear

monthName

Date  use

date or date# or timestamp or timestamp#

Week use

Week(fieldname)

month and time

Use

Month (Field) &' '& Time(Field)

Not applicable
Author

Try

Year(field),Month(field),Date(),Week(),Time() correspondingly

its_anandrjs
Champion III
Champion III

Try with the scripts

LOAD

DateColumn,

Date(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT'),'MM-DD-YY') as NewDateColumn,

Year(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT')) as Year,

Month(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT')) as Month,

MonthName(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT')) as MonthYear,

Week(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT')) as Week,

Time(Mid(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT'),10,5),'hh:mm') as Time;

LOAD * Inline

[

DateColumn

10-24-13 12:00 AM

10-25-13 12:00 AM

10-26-13 12:00 AM

10-27-13 12:00 AM

10-28-13 12:00 AM

10-29-13 12:00 AM

10-30-13 12:00 AM

];

its_anandrjs
Champion III
Champion III

If you have perfect timestamp filed then use

Date(DateField) as NewDateColumn,

Year(DateField) as Year,

Month(DateField) as Month,

MonthName(DateField) as MonthYear,

Week(DateField) as Week,

Time(DateField) as Time

maxgro
MVP
MVP

floor(field) to get the date

frac(field) to get the time