Date/Time On Time Plot X-Axis

Date/Time On Time Plot X-Axis

nmzenke
Enthusiast Enthusiast
185 Views
3 Replies
Message 1 of 4

Date/Time On Time Plot X-Axis

nmzenke
Enthusiast
Enthusiast

@moehlmann_feWas very helpful with a question about plotting global tables using calculated tables recently.

I have a follow on question but figured it should stand alone as it's own question.

 

Basically, when I have a global table that has a date/time column (stored as a string) and I pull that into the calculated table for plotting purposes it looks like that time plot does not accept that column as a valid x-axis which can be plotted against another column value on a y-axis.

Any ideas for what is going wrong here?

 

See the bottom chart on the attached model for the behavior. Thanks!

0 Likes
Accepted solutions (1)
186 Views
3 Replies
Replies (3)
Message 2 of 4

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

A string is not a value that inherits per default a rule to convert a date string into a number. All you can receive is an order like first string, second string, and so on. A statistical relation for a date must be a number and not just an order. If you convert a date string into a number, you have such an relation for a chart. 

Message 3 of 4

moehlmann_fe
Advocate
Advocate

To convert the string to FlexSim's datetime format, use the DateTime class.

https://docs.flexsim.com/en/25.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/DateTime.html...

Message 4 of 4

nmzenke
Enthusiast
Enthusiast

Thank you both for your comments. I pulled out the datetime to the global table using "Model.dateTime" and then pulled that into the calculated table. For anyone reading this, the key to make the date show up "looking like a date string" on the x-axis of the of the chart of the calculated table is to go to the "Display Format" tab of the calculated table and change the format from "Raw" to "Date/Time". This will make the plot you have show the date in a human readable string-style date format rather than in number form.

nmzenke_0-1755697939949.png