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

Problem set analyses week vs week in crosstable

Hi,

I'm having some trouble getting my Set Analyses formula to work.

Please review the table below:

ProductYearWeek2014.wk32014.wk42014.wk52014.wk5
Product AStartstock50000400003000025000
Endstock40000300002500015000
Product BStartstock5000400030002500
Endstock4000300025001500
Product CStartstock25000200001500012500
Endstock2000015000125007500
TOTALStartstock80000640004800040000
Endstock64000480004000024000

Please consider that my date table has a numeric sequence available for weeknumbers:

YearWeek%SEQ_DATUM_YWSALES
2014.wk254
2014.wk355
2014.wk456
2014.wk557
2014.wk658

StartstockSUM( STOCK ) [This Works]
EndstockSUM({<%SEQ_DATUM_YWSALES={$(=Max(%SEQ_DATUM_YWSALES)+1)}>}[STOCK]) [Does not work]

Startstock: Should show this weeks startstock (=stock)

Endstock: Should show next weeks startstock

What am I doing wrong?

Using Before(Stock) won't work properly, when only a few weeks are selected.

Thanks.

Minor tweak about what a formula should say

Het bericht is bewerkt door: Mark Added example file

13 Replies
Not applicable
Author

Also: Shouldn't max(Week) be looking at the week that comes with the displayed YearWeek in the crosstable?

Not applicable
Author

ok i looked at the qvw you posted and there is nothing wrong in you set analysis ;-9. the thing is that you selected the week 3,4,5 and if you look now at the weekseq your possible selection is 4,5,6 so if you use in set analysis max(weekseq + 1) then the result of this would be 7. and you have no data for the weeseq 7.

i hope this helps!

regards,

MT

Not applicable
Author

I now solved it by making a calculation in my script. I had hoped to prevent that. But that does work

MK_QSL
MVP
MVP

What Magdalena has explained, i explained two times 🙂