Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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

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

To extract date

Date(Floor(DateTimeField))

To extract time

Time(Frac(DateTimeField))

MVP
MVP

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

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

Community Browser