1. Set up a date island that contains combinations of all the dates and relevant dimensions (e.g. ProductID)
2. Set up an AccumulationKey alongside you Movements data, which you can test for to see if the month or date has changed the data
3. Load the Movement data into the date island, in reverse order, testing for whether the Accumulation key has changed. If it has (and a new month or date is being loaded) then you can load in the previous balance minus the sum of the movements
See this excellent example: http://community.qlik.com/message/100042#100042
If does the accumulation going forwards in time, but can be changed to go backwards in time.
I have a problem with this logic. Obviously I am doing something wrong, but I can't see where.
I adapted your logic, but for some reason I can't get anything into monthly opening balance.
Below is the script I am using in inventory accumulation calculation. I have also attached a picture from table view, in where you may see my problem
if(rowno() = 1 OR AccumulationKey <> peek(AccumulationKey), 0, peek(ClosingAmount)) AS OpeningAmount,
if(rowno() = 1 OR AccumulationKey <> peek(AccumulationKey), MonthlyMovementKG, peek(ClosingAmount) + MonthlyMovementKG) AS ClosingAmount,
date(makedate(MoveYear, MoveMonth), 'MM-YY') AS InvPeriod
Many thanks already beforehand!