where 40 is the sum of the [Qty] for the [Sdates] before 28-12-15, 44 is the sum of the [Qty] for the [Sdates] before 04-01-16, 51 is the sum of the [Qty] for [Sdaes] before 07-01-16 and so on…
I have used this formula
Sum([Qty] where([Sdates] < Pdate
where [Sdates] is the object in the universe and Pdates are the calculated weekly dates from [Sdates] for a specific range.
If 28-12-15 has 40 and 04-01-16 has 4, then you could use the RunningSum formula for what you need. I would expect that either that formula or Previous would work for you, depending upon the underlying data.
Thanks Mark for your reply! But how to get that 40? Because in [Sdate] there are some dates which are less than 28-12-2015. i.e [Sdate] starts with date 24-10-2015, and there are four dates against which the sum becomes equal to 40.
I can find the sum only for one week but finding it hard to calculate sum on weekly basis.
Now I need to find sum of [Qty] before the starting day of each week. i.e how much sum before the starting date of the week (28-12-15), how much sum of [Qty] before the starting data of the next week(04-01-16) and so on uptill the previous week of the current date.
So, thats why I calculated [Pdate]which is starting date of each week. finding sum.xls (35.0 KB)
Thanks for the reply and sorry for doing against the Board rules.
The attached report is just the sample report. I am still unable to get any value in the inventory column.(For the time being, I am considering only inventory column. )
Until you know where you get inventory numbers from as either a starting inventory or an ending inventory there’s not much we can do to help. You’ll need to ask your universe designer where you can get inventory numbers from. The two general rules of stock are:
I have rules to find inventory and I have mentioned this before that I can do the same report only for one week with correct results but for every week like in this case, I am getting it hard to do. If I get the sum of [Qty] for the dates before the starting date of the first week i.e. in this case, 28-12-2015 then for the next ones I can get by using RunningSum…I think.
Can you set up a week number variable for your date variable and do a running sum using the week number (using the week function with your date) as the reset variable?
I used the second data provider and put a filter for [Sdates] less than “28-12-2015”. This gives me the sum of quantity before the week accurately but when I place that qty in front of the date (which is the report requirement, the value doesn’t show up . the cell remains blank.
At the moment I’m working from memory so you’ll need to check the syntax (I’m most familiar with Deski and the Webi syntax doesn’t always match):
I’m not sure which date variable you want to use, but create a variable called week number which uses the date variable as the input object - week(date variable).
Then create another variable for your weekly sum using runningsum(quantity,week number).
Create a 2-column table and drop week number in the first column, and the weekly sum in the second.
You may need to fiddle around a bit… (I always tend to do this sort of report by trial and error.)
Hope this makes some sense! (You may want to take a look at dagira.com - there’s a lot of tips there - if I have to fiddle around with calculation contexts and resets I usually end up reading various blog articles there first.)