Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to parse a date/time field and use the time portion and date portion on a line chart?

We have a goal to use a line chart - time on the y axis and date on the x axis.  The format of the field is MMDDYYY hh:mm:ss tt.  So, the question is how to parse the field and use the time (example: 8:15 am) part and date  (example 12/30/2016) part on the line chart.

2 Replies
sunny_talwar

To extract date

Date(Floor(DateTimeField))

To extract time

Time(Frac(DateTimeField))

MK_QSL
MVP
MVP

As stalwar1‌ replied, this is what you can use to get Date and Time from a DateTime Field.

Only issue is .. as you mentioned that your DateTime Field is in MMDDYYYY hh:mm:ss tt ( I am assuming that you forgot one Y while mentioning DateTime format).. your TimestampFormat must be defined same.

SET TimestampFormat='MMDDYYYY hh:mm:ss TT';

If this is not the case, you have to use Interpretation and Formatting functions.

Date(Floor(TimeStamp#(DateTimeField,'MMDDYYYY hh:mm:ss TT'))) as Date

Time(Frac(TimeStamp#(DateTimeField,'MMDDYYYY hh:mm:ss TT'))) as Time

Please go through below link which will give you knowledge of these functions as well as how to get Date and Time field from DateTime.

Primer for QlikView Date fields

Happy Qliking.

Regards,

MK