21.08.2013 Views

LibreOffice 3.4 Calc Guide - The Document Foundation Wiki

LibreOffice 3.4 Calc Guide - The Document Foundation Wiki

LibreOffice 3.4 Calc Guide - The Document Foundation Wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

First syntax variation<br />

<strong>The</strong> target field specifies which data field of the Pivot Table is used within the function. If your<br />

Pivot Table has only one data field, this entry is ignored, but you must enter it anyway.<br />

If your Pivot Table has more than one data field, then you have to enter the field name from the<br />

underlying data source (for example “sales”) or the field name of the data field itself (for example<br />

“sum – sales”).<br />

<strong>The</strong> argument Pivot Table specifies the Pivot Table that you want to use. It is possible that your<br />

document contains more than one Pivot Table. Enter here a cell reference that is inside the area of<br />

your Pivot Table. It might be a good idea to always use the upper left corner cell of your Pivot<br />

Table, so you can be sure that the cell will always be within your Pivot Table, even if the layout<br />

changes.<br />

Example: GETPIVOTDATA("sales",A1)<br />

If you enter only the first two arguments, then the function returns the total result of the Pivot Table<br />

(“Sum – sales” entered as the field, will return a value of 408,765).<br />

You can add more arguments as pairs with field name and item to retrieve specific partial sums.<br />

In the example in Figure 222, where we want to get the partial sum of Hans for sailing, the formula<br />

in cell C12 would look like this:<br />

=GETPIVOTDATA("sales",A1,"employee","Hans","category","sailing")<br />

Figure 222: First syntax variation<br />

Second syntax variation<br />

<strong>The</strong> argument Pivot Table has to be given in the same way as for the first syntax variation.<br />

For the specifications, enter a list separated by spaces to specify the value you want from the<br />

Pivot Table. This list must contain the name of the data field, if there is more than one data field;<br />

otherwise it is not required. To select a specific partial result, add more entries in the form of<br />

Field name[item].<br />

In the example in Figure 223, where we want to get the partial sum of Hans for Sailing, the formula<br />

in cell C12 would look like this:<br />

=GETPIVOTDATA(A1,"sales employee[Hans] category[sailing]")<br />

Chapter 8 Using Pivot Tables 221

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!