Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can someone help me out with this set analysis expression? I have a chart that needs to calculate sum of last 15 month shipments based on the ReturnYear and ReturnMonth for each part number. For example, if ReturnMonth and ReturnYear is Apr 2007, the chart should display sum of all shipments from Jan 2006 to Mar 2007. After searching extensively on the community, I tried this as suggested in one of the posts but not getting the desired results.
There are two tables:
Shipments:
LOAD ShipDate,
date( Monthstart(ShipDate), 'MMM YY') as ShippedMonth,
date( yearstart(ShipDate), 'YYYY') as ShippedYear,
shippedQuantity,
Part_num,
.....
......
Returns:
LOAD ReturnDate,
date( Monthstart(ReturnDate), 'MMM YY') as ReturnMonth,
date( yearstart( ReturnDate), 'YYYY') as ReturnYear,
.....
.....
I created a chart (straight table) with first dimension as Part_num, second dimension ReturnYear, third dimension as ReturnMonth. The expression should calculate Sum(TotalShipped) for last 15 months.This is the expression I tried but not giving me the desired results.
sum({<ReturnDate=,ReturnYear=,ReturnMonth={">$(=date(addmonths(max(ShippedMonth),-15),'MMM YY')) <=$(=date(max(ShippedMonth),'MMM YY'))"}>} shippedQuantity)
Please help. Should I be loading Month and year in a different way?
Hi,
please see the attached example for help.
Good luck!
Rainer