Can any one advise me how to add a new calculated field in a pivot table.
Please see the below statement and let me know if this is correct.
PivotTables.AddCalculatedField("TotalError", "=SUM(GETPIVOTDATA('ERROR TYPE',$A$5,'PERIOD',2007.03,'REGION','Asia Pacific')-GETPIVOTDATA('ERROR TYPE',$A$5,'ERROR TYPE','CORRECT','PERIOD',2007.03,'REGION','Asia Pacific'))", false);
The generated Excel sheet is corrupted and i could not open the excel sheet.
My requirement is that, i generate a pivot table. The data field contains some 5 columns. Now i need to add another column next to the grand total. The values for this column is calulated, which gives the difference between the grand total and sum of all the data fields leaving the first column of the datafield.
Please let me know if you could understand the problem.
Also, suppose my pivot table is placed in the area "A5:G20", i could not able to retrive the values of the cells in between these areas. If i could get these cell values, then also my problem will be solved.