
PIVOTTABLE/SUM QUERY
MManders Apr 3, 2010 2:25 PM (in response to PADDYRU)If the sequence of the columns doesn't change, you could use the following expression for the third column
Column(1)Column(2)
Or just create an expression (new column) that subtracts the two expressions
(expression1)  (expression2)
PIVOTTABLE/SUM QUERY
PADDYRU Apr 3, 2010 9:03 PM (in response to MManders)Hi
Firstly thanks for taking the time to reply and help, much appreciated
However, the Pivot table I have shows the number of orders, displayed by Type, by either Period, Week, Day etc [depending on Group]
What i would like to show is the number of orders in one column and the difference compared to the previous in the next, and then repeat this for the next , for as many columns as required.
EXAMPLE
DATE 1 2 3
NUM DIFF NUM DIFF NUM DIFF
TYPE A 100  50 50 75 25
TYPE B 200  100 100 75 25
What expression would i need for this?
Sorry i wasn;t overly clear in my Previous Post.
Thanks

PIVOTTABLE/SUM QUERY
MManders Apr 4, 2010 9:38 AM (in response to PADDYRU)Ah, this looks more like you have a dimension DATE you want to pivot.
I think you want to use the Before function.
From the help:
before( [ total ] expression [ , offset [,n ]] )
Returns the value of expression evaluated with a pivot table's dimension values as they appear in the column before the current column within a row segment in the pivot table. This function returns NULL in all chart types except pivot tables.
On the first column of a row segment a NULL value will be returned, as there is no column before this one.
If the table is onedimensional or if the expression is preceded by the total qualifier, the current row segment is always equal to the entire row.
If the pivot table has multiple horizontal dimensions, the current row segment will include only columns with the same values as the current column in all dimension rows except for the row showing the last horizontal dimension of the inter field sort order.
The inter field sort order for horizontal dimensions in pivot tables is defined simply by the order of the dimensions from top to bottom.
Specifying an offset greater than 1 lets you move the evaluation of expression to columns further to the left of the current column. A negative offset number will actually make the before function equivalent to a after function with the corresponding positive offset number. Specifying an offset of 0 will evaluate the expression on the current column. Recursive calls will return NULL.
By specifying a third parameter n greater than 1, the function will return not one but a range of n values, one for each of n table columns counting to the left from the original cell. In this form, the function can be used as an argument to any of the special range functions.
Examples:
before( sum( Sales ))
before( sum( Sales ), 2 )
before( total sum( Sales ))
rangeavg (before(sum(x),1,3))
returns an average of the three results of the sum(x) function evaluated in the three columns immediately to the left of the current column.

PIVOTTABLE/SUM QUERY
PADDYRU Apr 6, 2010 7:01 AM (in response to MManders)Hi
Thanks for this, it has worked great and i now have a table with the values i want
One quick question though, when i go to Chart the values, i get nothing for the difference column, it says "no data to display"
Any ideas
Once again, thanks for the help


