Skip to main content
Solved

GI SUM of Days without Stock

  • August 3, 2023
  • 1 reply
  • 87 views

Jeff96
Captain II
Forum|alt.badge.img+4

I’m looking to create a GI with a item list and and a sum of how many days this item was at 0 qty in the warehouse in the past 365 days. 

 

Where do I start? 

I thought maybe using the INItemSiteHistDay table would be the way to go but I’m just not sure where to go from there.

Best answer by lauraj46

Hi @Jeff96 ,

You could the DateInfo table as a starting table to get the 365 dates.  The tricky bit after that is to get the total item quantity by warehouse (possibly with multiple locations) for any particular date.

The INItemSiteHistDay table only contains records for the dates where there is a change. 

Maybe someone else knows of a different DAC that already has the daily quantities.  In that case you should be able to do this in a GI.  Otherwise, I think would be easier and more efficient in a report. There you can sort the InItemSiteHistDay records by date and use variables to do some calculations.

A basic design might be something like this:

  • Cross join DateInfo with INItemSiteHistDay
  • Group by [InItemSiteHistDay.LocationID] and sort by [INItemSiteHistDay.sdate].
  • Create variables for the DailyLocQty and the DailyWHQty. 
  • In the detail section - if sdate is prior to DateInfo.Date, set the DailyLocQty = EndQty.  Since the records are sorted by date this will get you the last EndQty for that location. 
  • In the footer for the locationid - add the DailyLocQty to the DailyWHQty
  • In the footer for [DateInfo.Date] = if the DailyWHQty = 0 add 1 to the count

Hope this give you some ideas!

Laura

 

View original
Did this topic help you find an answer to your question?

1 reply

lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 590 replies
  • Answer
  • August 3, 2023

Hi @Jeff96 ,

You could the DateInfo table as a starting table to get the 365 dates.  The tricky bit after that is to get the total item quantity by warehouse (possibly with multiple locations) for any particular date.

The INItemSiteHistDay table only contains records for the dates where there is a change. 

Maybe someone else knows of a different DAC that already has the daily quantities.  In that case you should be able to do this in a GI.  Otherwise, I think would be easier and more efficient in a report. There you can sort the InItemSiteHistDay records by date and use variables to do some calculations.

A basic design might be something like this:

  • Cross join DateInfo with INItemSiteHistDay
  • Group by [InItemSiteHistDay.LocationID] and sort by [INItemSiteHistDay.sdate].
  • Create variables for the DailyLocQty and the DailyWHQty. 
  • In the detail section - if sdate is prior to DateInfo.Date, set the DailyLocQty = EndQty.  Since the records are sorted by date this will get you the last EndQty for that location. 
  • In the footer for the locationid - add the DailyLocQty to the DailyWHQty
  • In the footer for [DateInfo.Date] = if the DailyWHQty = 0 add 1 to the count

Hope this give you some ideas!

Laura

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings