16 Replies Latest reply: Jun 12, 2015 11:42 AM by Sunny Talwar RSS

    Help with preceding load

    Mark Graham

      I have SKU, Shipdate and Units packed in the table.


      1. Find the recent 30 days from today.   



      2. selecting the first ship date in the retrieved 30 days.   



      3.  Calculating diff, between today and the retrieved first ship date. 

      I can get these with the below preceding load script.


      LOAD SKU#, [Sum of Units packed in recent 30 days],(TODAY() - MinDate30) AS [Diff. of days in 30 days time frame];

      LOAD SKU#,Sum([Units Packed 30]) as [Sum of Units packed in recent 30 days], Min(FilteredDate30) AS MinDate30

      GROUP BY SKU#;

      LOAD SKU#, [Units Packed] AS [Units Packed 30],[Ship Date] AS FilteredDate30

      RESIDENT Table1

      WHERE [Ship Date] > TODAY()-31;


      But i need to calculate,


      velocity = ([Sum of Units packed in recent 30 days]/[Diff. of days in 30 days time frame]) and

      Relative velocity % per sku with the formula, Sum(Total(Velocity))/Velocity per SKU#.



      Can someone help.

      I'm struck