1 Reply Latest reply on Aug 18, 2014 3:35 PM by Dan Cory

    Parsing Date-Time: What causes the error map_eq_datetime_val_duration_val ?


      Hi there,


      I have a dataset that containts geocode, date, time, name of location and type of movement, to sum it up. It is a single user extract from a personal record history of an app called moves.


      I wanted to analyze  movement behavior by time of the day - but not by date. I thought about a gantt chart and have been working through steps of this example http://kb.tableausoftware.com/articles/knowledgebase/gantt-chart, adjusting it to the data and need (I wanted hour, not second for example). This didn't work.


      Then I thought about creating buckets (just like in this example http://3danim8.wordpress.com/2013/06/20/tableau-buckets-how-to-create-and-use-them/) for morning/noon/afternoon/evening/night for which I need to separate the time of the day from the field Date and Time (since the source currently comes as yyyy-mm-ddThh:mm:ssZ).


      I prepared a Tableau Data extract in order to be able to use the DATEPARSE function to achieve the mentioned time (only) field.

      After having had a valid calculated field (DATEPARSE("yyyy-mm-dd","hh:mm:ss") = #10:05:05#) and wanting to D&D this to the row shelf, I receive an error message:


      "Tableau Data Engine Error: 4: PrimitiveExp::MakePrimitive: map_eq_datetime_val_duration_val". I couldnt find any useful information when I googled for this error message. Did anyone else here encounter it before?


      My question:

      1) Does it make sense to use the DATEPARSE function or is there a simpler way to get a Time only field? If so, what would that be?

      2) If the answer to 1 is no, what could possibly have caused the error?


      The workbook is attached. The error pop up immediately upon opening it. Cancel it and you will be able to see the workbook. The analysis I am describing above was conducted on sheet 6. Field is dimension called "Start Time Parsed"


      Thanks for your ideas






        • 1. Re: Parsing Date-Time: What causes the error map_eq_datetime_val_duration_val ?
          Dan Cory

          Tableau doesn't have time only (duration) fields as a separate type. You can either represent them as numeric fields (ideally with 1 day = 1), or as date time fields all on a particular day.


          You can just change the data type on all your start and end fields to Date Time and they will work fine. There's no need to use DATEPARSE at all.


          If you do want to use DATEPARSE, you aren't using it correctly. The first parameter is supposed to the date format and the second parameter is the field you are trying to parse.


          If you want to make date time fields that all exist in a particular day, you can do something like:


          That will map [Start] to the corresponding time in #1/1/2001#.


          If you want to represent them as numeric fields, you can do:



          I think it is easier to make Gantt charts with date time fields.



          1 of 1 people found this helpful