12
Creating Pivot Charts Pivot Tables in Microsoft Excel may be turned into dynamic charts to present data in a graphic manner. These charts are linked to the data in the Pivot Table, and change when filters are enabled on the Pivot Table. We will start with a simple chart that will show Number of Hours by trade and earn code on a job. This data will be pulled from a table named v_job_history. This table is a VIEW that combines all Job Cost history and the associated descriptions so linking tables is not required. We start the query by pulling the appropriate data. (Note: you may want to add some date parameters for this report. Do so by adding the date_booked field in the Criteria with an “is between” Value to prompt for the date range) Rename the column headers in the Query and return the data to Excel. Job Trade Earn Code units 1 - Office Overhead 200 - Electrician REG 8 1 - Office Overhead 200 - Electrician REG 1 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician REG 40

Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

Creating Pivot Charts

Pivot Tables in Microsoft Excel may be turned into dynamic charts to present data in a graphic manner.

These charts are linked to the data in the Pivot Table, and change when filters are enabled on the Pivot Table.

We will start with a simple chart that will show Number of Hours by trade and earn code on a job. This data will be pulled from a table named v_job_history. This table is a VIEW that combines all Job Cost history and the associated descriptions so linking tables is not required.

We start the query by pulling the appropriate data.

(Note: you may want to add some date parameters for this report. Do so by adding the date_booked field in the Criteria with an “is between” Value to prompt for the date range)

Rename the column headers in the Query and return the data to Excel.

Job Trade Earn Code units1 - Office Overhead 200 - Electrician REG 81 - Office Overhead 200 - Electrician REG 11 - Office Overhead 211B - Electrician - Journeyman B REG 401 - Office Overhead 200 - Electrician REG 401 Office Overhead 200 Electrician REG 40

Page 2: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

Once the data is returned to Excel, access the INSERT tab, and select Pivot Table.

Set up the Pivot Table with the following options.

Right Click on the Pivot Table and select Pivot Table options. On the Display Tab, select “Classic Pivot Table Layout”

Page 3: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

You may turn the subtotals off on the Pivot Table to condense the data.

Make sure your cursor is in a cell within the Pivot Table. Select the Insert Tab on the Ribbon, and in the CHARTS section, choose “Column” as the chart type.

There are many styles to choose from in the Pivot Charts, we will start with the first selection; 2D Column.

Page 4: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

The Chart lands in the middle of the current screen. In order to move the chart to a separate page, right click on an EMPTY space on the chart and select MOVE CHART.

Select the option to place the chart in a new sheet and click OK.

Page 5: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

Your chart now resides on a new tab in the Excel sheet. Notice that you have the same filter options on the right hand side of the screen based on the setup of the Pivot Table.

You may use the Report Filter on the right hand side just as you would for the Pivot Tables. If this option is not available, or you closed out the Filter Pane, left click on the Pivot Chart, select the Analyze tab under the PivotChart Tools Ribbon and select PivotChart Filter.

Page 6: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

There are a great number of options to format these tables, too many to cover in a single session. Here are some of the more simple tweaks that you can enable to vary the look of your charts.

Under the Design Ribbon: Chart Options – select Layout 5. This is a nice format that shows totals under the axis labels on the bottom of the chart.

Notice the TOTAL row under the data columns.

You may also change the Chart Style to change the color and background.

Page 7: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

If you access the Tab with the Pivot Table again, you may change the layout, and in turn, change the layout of the chart. In this example, I will slide the Earn Code to the left of the trade.

When we look at the chart on the chart tab, notice how the X Axis has been changed to mirror the layout of the Pivot Table.

On the Layout Tab under the PivotChart Tools Ribbon, in the Labels section, select DATA Labels. You may choose to show the data labels in numerous sections of the columns.

Page 8: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

Click on the chart header to access and modify the title of the chart.

We will now create another query using the same table; v_job_history. This report will pull labor hours by Job and Cost Code where the Cost Class ID = 1 (labor) and the units are not 0.

Page 9: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

We can turn this Pivot Table into a Pivot Chart using one of the other formats. This chart now shows the number of labor hours by cost code within the job.

Another good use of the Pivot Chart is to analyze the G/L History.

Create a query from the GL_history table. The account field is selected as a combination of the gl history account id and the accounts table description as follows; gl_history.basic_account_id+' - '+accounts.description. The debit_credit field from the accounts table will be used and explained later.

Page 10: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

Insert a column to the right of the Date field. In the first column, use the END OF MONTH formula. This will allow us to consolidate the G/L activity by month.

Add a column to the right of the amount_cr that will net the amount of the DB and CR values. This formula will look at the “type” of account. If it is a “D” (Debit) type account, then the formula will subtract the amount_cr from the amount_db to show the net DB value. If it is a “C” (Credit) type account, the amount_db will be subtracted from the amount_cr. This keeps the DB/CR balances correct based on the type of account.

Page 11: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

Create the pivot table using the account and EOM (End Of Month) fields as ROW labels and the NET field in the VALUES section.

Create the Chart to track the information for the selected account. In this example, we are tracking the history of the Retained Earnings Account based on the G/L History.

Page 12: Creating Pivot Charts · 2012-01-27 · 1 - Office Overhead 211B - Electrician - Journeyman B REG 40 1 - Office Overhead 200 - Electrician REG 40 1 Office Overhead 200 Electrician

The BAR type Pivot Chart layout flips the AXIS for the charts.