3 Replies Latest reply on Aug 2, 2018 7:33 AM by Matthew Balph

    Return Last Date of Value Increase

    Matthew Balph

      I am trying to create a calculation and not sure how to get exactly what I need. For each location I ultimately need to generate the last month that a value has a positive increase (received new inventory) relative to the previous month, and if we've never received inventory report a default date, 5/1/18.

       

      This is what I have so far using table calculations

      Capture.PNG

      You can see two fields displayed to demonstrate the calculation:

       

      [Inventory Delta] (calc along [Date Interpreter], [Data Selection] allows the user to choose what inventory item to see):

      IF ISNULL(SUM([Data Selection])-LOOKUP(SUM([Data Selection]),-1))

      THEN 0

      ELSE SUM([Data Selection])-LOOKUP(SUM([Data Selection]),-1)

      END

       

      [Inventory Increase] ([Date Interpreter] is to convert the dates into a format Tableau recognizes)

      IF [Inventory Delta] > 0 THEN MIN([Date Interpreter]) ELSE #5/1/2018# END

       

      Looking at this I want to return the MAX of the [Inventory Increase], aggregated to all time, but this does not work, as the table calculation requires the [Date Interpreter] field. I also cannot combine table calculations with FIXED calculations, so I'm not sure if my approach will work. I can make a dummy workbook if needed. Thanks,

       

      Matt