Shoot, sorry, I meant to put the version details in my post.
CR 2008, and yes this is an inserted crosstab (so you are seeing summaries).
My real report is actually a little different from the "example" (the end result is still the same).
It's actually a report that pulls 13 months of data from a GL transaction table. Current month plus prior 12 months. There is a calculated member column that takes the prior twelve months and determines the average. That formula is:
(
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -13, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -12, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -11, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -10, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -9, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -8, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -7, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -6, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -5, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -4, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -3, {@MyCalcDate}))), CurrentSummaryIndex) +
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -2, {@MyCalcDate}))), CurrentSummaryIndex)
)
/
12
If curious, "@MyCalcDate" is a formula:
Global dateVar mycalcdate;
If {?AcctPeriod}=12 then
mycalcdate := Date ({?FiscalYear}+1, 1 ,1 )
else
mycalcdate := Date ({?FiscalYear},{?AcctPeriod}+1 ,1 );
Right or wrong, I base part of my filter on posting dates less than "mycalcdate" (which is the first day of the next month).
The variance column calculation, because I could not figure out how to do a difference calculation off of a calculated member, is simply:
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf(CDate (DateAdd ("m", -1, {@MyCalcDate}))), CurrentSummaryIndex)
and then minus that same "average" formula above.
So, end result in that variance column is Current Month minus 12-prior month Average.
My rows are a concatenated string of GL account numbers and the account descriptions. Right now, this appears to be the only way to sort this cross tab.
My "regular" cross tab columns are the 13 periods, using the Cross Tab Expert to group by another formula called "@MyCurrentDate"...which, is basically the first day of the current month. It's grouped in ascending order and a column is printed "for each month" and the value printed is "the first date in the period".
So, end result, I still want to sort by "best" variance to "worst" variance.