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.
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.