Hexagon Geospatial
MENU

Smart M.App

Looking for answers in regards to M.Apps, M.App Exchange or M.App Studio? Smart M.App Tech Discussion board is where you can search, ask your questions and assist others by sharing your knowledge. Join the conversation, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Frequent Contributor
Posts: 145
Registered: ‎02-17-2016
Accepted Solution

Incident Analyzer - date format

I am trying to use a date field with data such as 20160104120754. When selecting the Date/Time Format of %Y%m%d%H%M%S, the format is not accepted. What is the correct format for this date, which is YYYYmmddHHMMSS ? Thanks, 

Technical Evangelist
Posts: 36
Registered: ‎07-12-2016

Re: Incident Analyzer - date format

Hello,

 

The date format %Y%m%d%H%M%S looks correct for the value 20160104120754. If this format is not working, ensure the date values are correct in the source file. Sometimes when using Excel, large values, such as these, can be turn into exponent based values. For example, below is a sample CSV file created to illustrate what can happen to dates like yours.

 

Sample CSV file with correctly formatted Date field:

 

Longitude,Latitude,Date,Theme

-76.8890374,40.26978423,20160104120754,1

-76.89853744,40.27827333,20160104120754,2

-76.86965709,40.25918613,20160104120754,3

-76.87709246,40.25886466,20160104120754,3

-76.83478797,40.23226552,20160104120754,2

 

Open this file in Excel:

 

Longitude

Latitude

Date

Theme

-76.8890374

40.26978423

2.01601E+13

1

-76.89853744

40.27827333

2.01601E+13

2

-76.86965709

40.25918613

2.01601E+13

3

-76.87709246

40.25886466

2.01601E+13

3

-76.83478797

40.23226552

2.01601E+13

2

 

If I save this file as is, the date will not be read by Incident Analyzer, as the date has now been changed.

 

 

Change the format of the Date cells to a General number:

 

Longitude

Latitude

Date

Theme

-76.8890374

40.26978423

20160104120754

1

-76.89853744

40.27827333

20160104120754

2

-76.86965709

40.25918613

20160104120754

3

-76.87709246

40.25886466

20160104120754

3

-76.83478797

40.23226552

20160104120754

2

 

 

If I save this file as is, the date should be read by Incident Analyzer using the format noted above.

 

 

Please note when using Excel to manage and edit CSV files, “what you see on screen is what you get when the file is saved to disk”. Given this, check your CSV file, make sure columns are wide enough to contains the entire value. I often  open the file in Notepad or WordPad to make sure the values I have are what I expect.

 

I hope this helps.

Technical Evangelist
Posts: 36
Registered: ‎07-12-2016

Re: Incident Analyzer - date format

Hello,

 

Thank you for providing the sample data as it really did help diagnois the issues you reported in the original post. As a result of my investigation, I actually found a bug, but the good news is, there is a simple work around.

 

The bug relates to the names you used as headers. More specifically, some of your column headers contained leading spaces.

 

 

Original Headers:

agency_event.eid, agency_event.cdts,priority, tycod, sub_tycod, latitude,longitude,x_cord, y_cord

 

Modified Headers:

agency_event.eid,agency_event.cdts,priority,tycod, sub_tycod,latitude,longitude,x_cord,y_cord

 

 

As a result of these leading spaces, Incident Analyzer was not able to parse the CSV file correctly. Given this, I used WordPad, to remove the leading spaces. I then saved the file and then went into Incident Analyzer and all was good.  We will get the fix for this issues in the next release, but for now you should be good to go.

 

Thank you again for providing the data, as having it was extremely helpful.

 

Robert

 

Frequent Contributor
Posts: 145
Registered: ‎02-17-2016

Re: Incident Analyzer - date format

I supplied the data to Robert, and he noted that my header line had spaces after the commas. Removing these spaces resolved my issue.

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.