2 Replies Latest reply on May 21, 2018 8:38 PM by Gavin Wyborn

    Tableau Prep Latest Date from List of Values based upon two sets of criteria

    Gavin Wyborn

      Dear Tableau Prep Guru's,

      I'm new to Tableau Prep but have been using Tableau for some time.

      I have a Tableau Prep Flow where I need to identify the Latest Date item to create a calculated value [Latest].

      My Date Field [DateCalc] was created using a calculated field generated from the [Year] and [Month] fields.

      I've looked at LOD calculations but these don't seem to work the way I need them to in Tableau Prep.

      I tried {FIXED [Code]: MAX([DateCalc])} I then tried using the MAX([DateCalc]) function but it seems the Max/Min functionality in Tableau Prep works differently from Tableau Desktop, and only takes two arguments.

      My data set has two year's worth of values (about 230k rows) by Type [Type], by Year [Year], by Month [Month], by Production Code [Code], and by Used/Origin(al) [Use].

      My end goal is to output a set of data for a specific Type [Type] & Production [Code] that was [Use]d where the [Use] date is the latest use date in the record set of [Type], [Code] & [Use].

      My Current Data set is Shown below:

       

      The Result I need is as follows:

      Which would result in the following data output from Tableau Prep.

      Any help the Tableau Community can give regarding how to identify the latest items is much appreciated.

       

      Best regards,

      Gavin.

       

                                                                                                                                                                                                                                                                                

      Current Data Set
      [Type][Code][Year][Use][Month][FX][Value][CCY][DateCalc]
      RPBOI05K0201604152017Origin66.61.1453RMB2017/6/28
      RPBOI05K0201604152017Used66.61.15RMB2017/6/28
      RPBOI05K0201604162017Used66.61.1453RMB2017/6/28
      ZPBOI05K0201604162017Origin86.60.52136RMB2017/8/28
      TGPBOI05K0201604162017Used86.61.15RMB2017/8/28
      TGPBOI05K0201604162017Used96.61.15RMB2017/9/28
      TGPBOI05K0201604152017Used116.61.15RMB2017/11/28
      ZPBOI05K0201604152017Origin126.60.52136RMB2017/12/28
      ZPBOI05K0201604152017Used126.60.52RMB2017/12/28
      IPBOI05K0201604152016Used26.64.3RMB2016/2/28
      IPBOI05K0201604152016Used36.64.15RMB2016/3/28
      IPBOI05K0201604152016Used36.64.17RMB2016/3/28
      RPBOI05K0201604152016Used46.61.17RMB2016/4/2