Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a set of inventory data. I would like to create a chart or table that shows inventory status on the last day of the week. So If I would choice weeks from nr.1 to nr.10 it would sum the inventoryvalue for the last day of all the weeks. Is this possible with set analysis?
The data looks something like this.
InvTrans:
LOAD * INLINE [
Date, Product,Store,Qty,EntryType
2017-02-28, 1,1,100,0
2017-03-01, 1,1,-10,1
2017-02-28,2,2,100,0
2017-03-03, 2,2,-10,1
2017-03-02, 1,1,100,2
2017-03-02,2,2,500,2
2017-03-04,1,2,-50,1
];
Any hints greatly appreciated.
Regards
Birkir
Maybe like
=Sum({<Date = {"=WeekDay(Date)=6"}>} Qty)
But it would be good to create a flag in your script that flags dates that fulfill your requirement:
LOAD
Date,
If(WeekDay(Date) =6,1,0) as LastWeekDayFlag,
...
then
=Sum({<LastWeekDayFlag = {1} >} Qty)
Maybe like
=Sum({<Date = {"=WeekDay(Date)=6"}>} Qty)
But it would be good to create a flag in your script that flags dates that fulfill your requirement:
LOAD
Date,
If(WeekDay(Date) =6,1,0) as LastWeekDayFlag,
...
then
=Sum({<LastWeekDayFlag = {1} >} Qty)
Hi Stefan,
Thank you for the help. This works like a charm, I think I will use the LastWeekDayFlag. Would this be a good idea or practice to put it into a mastercalendar load?
Regards
Birkir
Yes, that's what I would do.