8 Replies Latest reply: May 30, 2018 7:00 AM by Hung dep RSS

    How to get Inventory by week from days

    Hung dep

      Hi folks,

      Thanks for helping me in previous topics. Now i have another concern:

       

      I got a inventory data table like this:

      DATESTORESKUINVENTORY
      1/1/2018Aa5
      1/1/2018Ab2
      1/1/2018Ac3
      1/2/2018Aa6
      1/2/2018Ab0
      1/2/2018Ac5
      1/3/2018Aa1
      1/3/2018Ab2
      1/3/2018Ac2
      1/3/2018Ba2
      1/3/2018Bb4
      1/3/2018Bc8

       

       

      Note: Some store have daily inventory data, some just have 1 day/week.

       

      Now what i want is: Measuring inventory by SKU by Store by Week; like this:

       

      WeekSTORESKUINVENTORY
      1Aa1
      1Ab2
      1Ac2
      1Ba2
      1Bb4
      1Bc8

       

      which means:

      • if stores have only 1 day data in a week -> that day would be the inventory for that whole week
      • if stores have many day data in a week -> the latest day inventory will be that week final inventory

       

      Can anyone tell me how to write the expression or load in script?

      Thank you all.