Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Maybe it's an easy question - but I can't find a way after spending a few hours with some ideas & looking around.
I've got a Year Dimension, restricted to only one selection. Now I want to have a straight table with:
Year | Sum(x) |
---|---|
2012 (actual selection) | 1000 |
2011 (actual selection-1) | 800 |
Displaying the actual selection and selection-1 is working fine by:
=ValueLoop((GetFieldSelections(Year))-1,(GetFieldSelections(Year)))
(as calculated dimension)
But...how do I set the filter to the data refering to the row? The only function I know is above, tried it with a negative offset but seems like it's not working.
I guess it's a simple problem and it seems like they had an example in qlikview v9, but I don't have the qvw (just saw it on a screenshot).
How can I solve this small problem?
Thanks
I wouldn't use ValueLoop() for this, which creates a synthetic dimension, not connected to your data model.
Try using Year as dimension and then use a set expression to filter the data based on your selection:
=sum({<Year= {">=$(=max(Year)-1)<=$(=max(Year))"}>} Sales)
to show the sum of Sales for the selected Year and the Year before.
Hope this helps,
Stefan
Hi,
Try like this,
ValueLoop($(=Max(Year)-1),$(=Max(Year))) used as dimension..
Hope it helps