I am trying to use two column totals from a crosstab report to calculate a third figure.
Basically I have two columns of values ([type] is either 'income' or 'expenditure') and want to take the total of income from expenditure in the summary line, or beneath it so that it reads-
'Profit or Loss' = [income.sum] - [expenditure.sum]
Here is the crosstab code as it stands at the moment -
select 'dbr.subtitle', ConCat('Summary (P&L) View for ', inTourCode, ' Departing: ', inDeparting );
select 'dbr.crosstab', 'type';
select 'dbr.sum', 'value';
select 'dbr.crosstab.title', 'Profit or Loss';
select 'dbr.summary.text','item','Totals';
select item,
type,
value
from mydbr.summary_tmp;
Any help greatly appreciated!