Difference between revisions of "Documentation/OOo3 User Guides/Calc Guide/DataPilot example 2"
Line 20: | Line 20: | ||
=== Solution === | === Solution === | ||
− | To use the | + | To use the Pivot Table for this task, collect all data into one single table. This can be done either manually or by importing a file from an (electronic) timekeeping machine. |
− | In very simple cases each employee takes care of their own working hours. If you need calculations that cover several employees, departments, or the whole company, just copy everything into one huge table. | + | In very simple cases, each employee takes care of their own working hours. If you need calculations that cover several employees, departments, or the whole company, just copy everything into one huge table. |
[[Image:CG3Ch6F12.png|thumb|none|500px|''Data basis in Calc'']] | [[Image:CG3Ch6F12.png|thumb|none|500px|''Data basis in Calc'']] | ||
− | Using the | + | Using the Pivot Table just needs 12 mouse clicks and gives you within a few seconds a nice overview: |
# Select the cell '''A1''' (or any other single cell within the list). | # Select the cell '''A1''' (or any other single cell within the list). | ||
− | # Choose | + | # Choose {{menu|Data|Pivot Table|Create}} and click {{key|OK}}. |
− | # On the | + | # On the Pivot Table dialog: |
#* Drag '''date''' into the ''Row fields'' area. | #* Drag '''date''' into the ''Row fields'' area. | ||
#* Drag '''hours''' into the ''Data fields'' area. Notice that it becomes '''Sum – hours'''. | #* Drag '''hours''' into the ''Data fields'' area. Notice that it becomes '''Sum – hours'''. | ||
#* Drag '''name''' into the ''Column fields'' area. | #* Drag '''name''' into the ''Column fields'' area. | ||
− | # Click | + | # Click {{button|More}} to show more options in the lower part of the dialog. |
− | # In the ''Results to'' field, select '''– new sheet –''' from the | + | # In the ''Results to'' field, select '''– new sheet –''' from the drop-down list. |
− | # Click | + | # Click {{key|OK}}. |
− | [[Image:CG3Ch6F13.png|thumb|none|500px|'' | + | [[Image:CG3Ch6F13.png|thumb|none|500px|''Pivot Table dialog'']] |
The result appears on a new sheet. | The result appears on a new sheet. | ||
− | [[Image:CG3Ch6F14.png|thumb|none|500px|''The evaluation, done within seconds with | + | [[Image:CG3Ch6F14.png|thumb|none|500px|''The evaluation, done within seconds with Pivot Table'']] |
The result is much more powerful than is possible with the classic formula-based calculation. For example, you can summarize the daily results to a monthly result very easily. | The result is much more powerful than is possible with the classic formula-based calculation. For example, you can summarize the daily results to a monthly result very easily. | ||
Line 48: | Line 48: | ||
<ol> | <ol> | ||
<li>To group together the rows, select the cell '''A5''' (or any other cell that contains a date).</li> | <li>To group together the rows, select the cell '''A5''' (or any other cell that contains a date).</li> | ||
− | <li>Choose | + | <li>Choose {{menu|Data|Group and Outline|Group}} and click {{key|OK}}. The result is now grouped into months.</li> |
[[Image:CG3Ch6F15.png|thumb|none|500px|''Monthly sums'']] | [[Image:CG3Ch6F15.png|thumb|none|500px|''Monthly sums'']] | ||
</ol> | </ol> | ||
− | If you need a result with a percentage, start the | + | If you need a result with a percentage, start the Pivot Table from this page. |
<ol> | <ol> | ||
− | <li>Select the cell '''A3''' (or any other cell that contains a result of the | + | <li>Select the cell '''A3''' (or any other cell that contains a result of the Pivot Table).</li> |
− | <li>Choose | + | <li>Choose {{menu|Data|Pivot Table|Create}}.</li> |
<li>Double-click on the field '''Sum – hours''' to open the Data Field dialog.</li> | <li>Double-click on the field '''Sum – hours''' to open the Data Field dialog.</li> | ||
− | <li>Click on | + | <li>Click on {{button|More}}, to see more options.</li> |
<li>Switch '''Displayed value > Type''' to '''% of column'''.</li> | <li>Switch '''Displayed value > Type''' to '''% of column'''.</li> | ||
[[Image:CG3Ch6F16.png|thumb|none|500px|''Properties of the data field'']] | [[Image:CG3Ch6F16.png|thumb|none|500px|''Properties of the data field'']] | ||
− | <li>Click | + | <li>Click {{key|OK}} twice.</li> |
</ol> | </ol> | ||
Line 71: | Line 71: | ||
[[Image:CG3Ch6F17.png|thumb|none|500px|''Result with percentages'']] | [[Image:CG3Ch6F17.png|thumb|none|500px|''Result with percentages'']] | ||
− | To get a comparison between employees, start the | + | To get a comparison between employees, start the Pivot Table again: |
− | # Select the cell '''A3''' (or any other cell that contains a result of the | + | # Select the cell '''A3''' (or any other cell that contains a result of the Pivot Table). |
− | # Choose | + | # Choose {{menu|Data|Pivot Table|Create}}. |
# Double-click on the field '''Sum – hours''' to open the Data Field dialog. | # Double-click on the field '''Sum – hours''' to open the Data Field dialog. | ||
− | # Click | + | # Click {{button|More}}, to see more options. |
#* Switch the ''type'' of the Displayed value to '''Difference from'''. | #* Switch the ''type'' of the Displayed value to '''Difference from'''. | ||
#* Switch the ''Base field'' to name. | #* Switch the ''Base field'' to name. | ||
#* Switch the ''Base item'' to Brigitte. | #* Switch the ''Base item'' to Brigitte. | ||
− | # Click | + | # Click {{key|OK}} twice. |
[[Image:CG3Ch6F18.png|thumb|none|500px|''Absolute comparison with Brigitte'']] | [[Image:CG3Ch6F18.png|thumb|none|500px|''Absolute comparison with Brigitte'']] | ||
− | As a final example we switch to an accumulated view; that is, continuing sums of all values: | + | As a final example, we switch to an accumulated view; that is, continuing sums of all values: |
− | # Choose | + | # Choose {{menu|Data|Pivot Table|Create}}. |
# Double-click on the field '''Sums – hours''' to open the Data Field dialog. | # Double-click on the field '''Sums – hours''' to open the Data Field dialog. | ||
− | # Click | + | # Click {[button|More}}, to see more options. |
#* Switch the type of the displayed value to '''Running total in'''. | #* Switch the type of the displayed value to '''Running total in'''. | ||
#* Switch the ''Base field'' to '''Date'''. | #* Switch the ''Base field'' to '''Date'''. | ||
− | # Click | + | # Click {{key|OK}} twice. |
− | [[Image:CG3Ch6F19.png|thumb|none|500px|''The | + | [[Image:CG3Ch6F19.png|thumb|none|500px|''The Pivot Table now shows accumulated values'']] |
=== Differences and advantages === | === Differences and advantages === |
Revision as of 11:14, 28 August 2024
This example is often used by consultants and in several variations in user support. The task is to provide a means for one or more users to keep track of working hours.
A typical way of doing this is to create a spreadsheet per month and a sum sheet with all the results of one year. For each employee, there is one file.
Practical problems and questions
- It is very difficult and time-consuming to create the timekeeping table: 12 sheets that have to be copied from a raw template and adjusted for each month, and a sheet with all the yearly sums with references to all the other sheets. Users often search for a macro to make the creation easier.
- The file shown contains only the data for one employee. How can you get all the data for all the employees, so that you can have a summary of all the work hours from all employees of a department or the whole company?
- How can you compare employees of a department or the whole company?
- The file shown contains data for one year. How can you compare it with the data of the previous years?
Solution
To use the Pivot Table for this task, collect all data into one single table. This can be done either manually or by importing a file from an (electronic) timekeeping machine.
In very simple cases, each employee takes care of their own working hours. If you need calculations that cover several employees, departments, or the whole company, just copy everything into one huge table.
Using the Pivot Table just needs 12 mouse clicks and gives you within a few seconds a nice overview:
- Select the cell A1 (or any other single cell within the list).
- Choose Data → Pivot Table → Create and click OK .
- On the Pivot Table dialog:
- Drag date into the Row fields area.
- Drag hours into the Data fields area. Notice that it becomes Sum – hours.
- Drag name into the Column fields area.
- Click More to show more options in the lower part of the dialog.
- In the Results to field, select – new sheet – from the drop-down list.
- Click OK .
The result appears on a new sheet.
The result is much more powerful than is possible with the classic formula-based calculation. For example, you can summarize the daily results to a monthly result very easily.
- To group together the rows, select the cell A5 (or any other cell that contains a date).
- Choose Data → Group and Outline → Group and click OK . The result is now grouped into months.
If you need a result with a percentage, start the Pivot Table from this page.
- Select the cell A3 (or any other cell that contains a result of the Pivot Table).
- Choose Data → Pivot Table → Create.
- Double-click on the field Sum – hours to open the Data Field dialog.
- Click on More , to see more options.
- Switch Displayed value > Type to % of column.
- Click OK twice.
The result shows percentages as a decimal number. If you prefer to have a percent format, select the cells and click on the % icon in the menu bar.
To get a comparison between employees, start the Pivot Table again:
- Select the cell A3 (or any other cell that contains a result of the Pivot Table).
- Choose Data → Pivot Table → Create.
- Double-click on the field Sum – hours to open the Data Field dialog.
- Click More , to see more options.
- Switch the type of the Displayed value to Difference from.
- Switch the Base field to name.
- Switch the Base item to Brigitte.
- Click OK twice.
As a final example, we switch to an accumulated view; that is, continuing sums of all values:
- Choose Data → Pivot Table → Create.
- Double-click on the field Sums – hours to open the Data Field dialog.
- Click {[button|More}}, to see more options.
- Switch the type of the displayed value to Running total in.
- Switch the Base field to Date.
- Click OK twice.
Differences and advantages
These examples show an important aspect of the DataPilot. Normally you have to collect your data according to the way you want the result to be represented. This means you have to use a specific structure and you’re stuck with it.
The DataPilot works more like a real database. The source data are collected in a simple spreadsheet that contains all data. Only when you want to look at it, you select which part of the data you want to use.
Content on this page is licensed under the Creative Common Attribution-Share Alike 3.0 license (CC-BY-SA). |