Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm having some trouble getting my Set Analyses formula to work.
Please review the table below:
Product | YearWeek | 2014.wk3 | 2014.wk4 | 2014.wk5 | 2014.wk5 |
Product A | Startstock | 50000 | 40000 | 30000 | 25000 |
Endstock | 40000 | 30000 | 25000 | 15000 | |
Product B | Startstock | 5000 | 4000 | 3000 | 2500 |
Endstock | 4000 | 3000 | 2500 | 1500 | |
Product C | Startstock | 25000 | 20000 | 15000 | 12500 |
Endstock | 20000 | 15000 | 12500 | 7500 | |
TOTAL | Startstock | 80000 | 64000 | 48000 | 40000 |
Endstock | 64000 | 48000 | 40000 | 24000 |
Please consider that my date table has a numeric sequence available for weeknumbers:
YearWeek | %SEQ_DATUM_YWSALES |
2014.wk2 | 54 |
2014.wk3 | 55 |
2014.wk4 | 56 |
2014.wk5 | 57 |
2014.wk6 | 58 |
Startstock | SUM( STOCK ) [This Works] |
Endstock | SUM({<%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
Also: Shouldn't max(Week) be looking at the week that comes with the displayed YearWeek in the crosstable?
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
I now solved it by making a calculation in my script. I had hoped to prevent that. But that does work
What Magdalena has explained, i explained two times 🙂