9 Replies Latest reply on Sep 26, 2017 9:00 AM by John Hobby

    I have 3 fields: Delivery Date, Z1 ID, Z2 ID. I need to concatenate them, however Delivery Date needs to be in "yyyymm" format.

    Steven Ming

      Hello All,


      Z1/Z2 ID are both Strings and Delivery Date is a Datetime/Date object and needs to be displayed as yyyymm format. The current issue that I have is I do not know how to transform the delivery date field into that yyyymm format, and then concatenate it as a string to the end of the result string.


      I have tried:


      1) Editing the display format of the "Delivery Date" field into yyyymm custom format, however the field still remains a datetime/date object, and when I use the STR() function it is displayed for example as:  Feb 25 2014 12:00:00 AM

      2) Using DATEPARSE in a separate calculation in the following: DATEPARSE("yyyymm", [Delivery Date]), however when I add this to my final calculation and try to display it, Tableau does not accept the result, and crashes.


      An Example of what I am currently getting:


      Z1 IDZ2 IDDelivery DateIncorrect Result
      Zone1Zone22014/02/25 12:00:00 AMZone1Zone2Feb 25 2014 0:00:00 AM


      An example of the result that I want:



      Z1 IDZ2 IDDelivery DateRequired Result
      Zone1Zone22014/02/25 12:00:00 AMZone1Zone2201402


      Message was edited by: Steven Ming