Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I hv list box with fieldname as month with values jan,feb,mar,.....
i hv pivot table with prodname,current_sale,previous_sale
i need previous row to be get displayed in previous_sale if my current selection is march it should show the sale of feb...
if feb then sale of jan to be get displayed
how to show the previous row datas easily....
pls help me out,,,
Hi,
Add another field in your table as Month number. Its better if you are using a calendar jus add another field as num(Month). In your expression you can use the month no . Also add a Variable vPrevMonth = num(Month)-1
eg: Sum({<MonthNo={$(#vPrevMonth)>} Sales)
Regards,
Syed.
Set analysis will work, but ONLY if a single month is selected. A set is built once for the entire table, so if multiple months are selected, it fails.
My usual suggestion is therefore to build an AsOf table. You wouldn't do an inline load like this, but to give the idea of the data structure:
AsOfMonth, MonthType, Month
Oct 2010, Current, Oct 2010
Oct 2010, Previous, Sep 2010
Sep 2010, Current, Sep 2010
Sep 2010, Previous, Aug 2010
Then use AsOfMonth instead of Month in your pivot table, and add MonthType as a dimension. Then the expression is a simple sum(Sales), with no conditional logic.