Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum all values before every Month

Hi,

I am trying to create Stock Ending Balance every Month from Item Legder table.

Item Ledger table contains daily stock movement (stock in and stock out)

I was hoping to get the following result:

2008, 2009, 2010, 2011, 2012 (2012 is selected)

Item JanFebMarAprMayJunJulAugSepOctNovDec
A001121414141315161715131819
A0020055101010157777
A0031005050302050202020303030
A004507010000000000

The value in January is accumulation of all values from 2008 up to the end of 2011.

The value in February is accumulation of all values from 2008 up to the end of 2011 + values in January 2012.

The value in February is accumulation of all values from 2008 up to the end of 2011 + values in January and February 2012, and so on.

I have attached excel file containing data from 2002 - 2004.

4 Replies
Not applicable
Author

Hi

Could you give sample data file?

Karthik    

Not applicable
Author

I have attached the excel file. Thanks

nirav_bhimani
Partner - Specialist
Partner - Specialist

Hi,

Try this,

In Script // QuarterStart(CalendarDate) as QuaterStartDate,

In Variable //vMaxDate= Max(CalendarDate) OR vMaxDate= (Today())

                                   

(sum(
{<
CalendarDate = {">=$(= Date (
min({<CalendarWeek=, CalendarQuarter=, CalendarMonth=>} QuaterStartDate )))<=$(vMaxDate))" }
, CalendarWeek=, CalendarQuarter=, CalendarMonth=
>}
Stock))

Regards,

Nirav Bhimani

Not applicable
Author

Hi Nirav,

I have tried your solution but unfortunately it didn't work.

It is quite impossible to generate report to look exactly like like illustrate before.

However, I got the workaround. I make 1 expression for each month. It was much easier.

Anyway, thanks for helping.