# Lesson 15: Basic Charting – Nonbillable Expenses by Year

The objective of this lesson is to create a bar chart that compares non-billable expense by type for two years. We will also look at the breakdown by office.

## Create a Basic Chart

Right-click on the Expense Analysis (Line Item/Matter) object and select NEW > CHART.

## Add a Dimension and a Measure

1. Add Header (Segment) – LineItem (Segment) - LineItemType (Segment) – Expense (Field) to the X-Axis. This will list every expense type on the X-Axis. Later we can explore how to deal with having too many expense types.
2. Add Header (Segment) – LineItem (Segment) - LineItem_Matter (Segment) – Amount (Field) as the Measure. Since we will filter by matter later, we need to be sure to get the amount from LineItem_Matter (segment) rather than LineItem (segment).

## Add the Transaction Year as a Series

We are interested in seeing how expenses changed over a two-year period. So add the Header (Segment) - LineItem (Segment) - TransactionYear (Field) as a Legend (Series).

## Add a Filter to Include Only Non-billable Matters

1. In the Data tab, in the Filter group, select FILTER.
2. Build a Where condition.
• Set the <Field> as Header (Segment) - LineItem (Segment) - LineItem_Matter (Segment) – Matter (Segment) – IsBillable (Field).
• Condition is Equal to.
• Set the < Value > constant to 0. In the sample database this indicates that the matter is non-billable. In your data, you may have other criteria (e.g. the GLAccount is blank).

## Change the Chart Appearance

1. Since we have a lot of expense types, we need to change the position of the X -Axis expense labels to make them fit better in the window. In the Format tab, in the Labels group, select the Axes drop-down menu.
2. Select Horizontal Axis > Rotate Horizontal Labels > 45.

## Change the Theme and Add a Title

1. In the Home tab, in the Report group, select the Header & Footer drop-down menu. Add a page header of Non-billable Expenses.
2. In the Home tab, in the Report group, select Theme. In the window, click Libraries > Templates. Choose the ENgradient_combine.sty and click OPEN.

## Create a Chart for Each Office

1. First, run the report for the whole firm.
2. Now we can create a chart for each office, based on the expense owner's "Office" entity. To do this we will use Header (Segment) – OwnerFlat (Segment) – OwnerFlatEntity (Segment). This segment was created to simplify the access to person entity information.
• Drag the Header (Segment) – OwnerFlat (Segment) – OwnerFlatEntity (Segment) - OFFICE (field) to the Multi-graph field container.

## Save and Run the Chart

1. In the Quick Access Toolbar, click the SAVE button. Save the chart in this location: Content > [Your Company Name] > My Content.
2. Name the report “Lesson 15 - Basic Charting - Nonbillable Expenses by Year."
3. In the Quick Access Toolbar, click the RUN button. There will be a separate chart for each office.

<% if (allItems.length > 1) { %>

<% } %>
<% var getColumnClasses = function(numberColumns) { var classNames = 'col-12'; if (numberColumns >= 2) classNames += ' md:col-6'; if (numberColumns >= 3) classNames += ' lg:col-4'; if (numberColumns >= 4) classNames += ' xl:col-3'; return classNames; } %>

<% } %>
<% var getColumnClasses = function(numberColumns) { var classNames = 'col-12'; if (numberColumns >= 2) classNames += ' md:col-6'; if (numberColumns >= 3) classNames += ' lg:col-4'; if (numberColumns >= 4) classNames += ' xl:col-3'; return classNames; } %>

<% } %>
<% var maxSections = 5 %>
<% if (sections.length) { %>
<% sections.forEach(function(section) { %>
• <%= partial('partial-article-list-sections', { id: 'section-' + section.id, parentId: '#' + id, sections: section.sections, activeCategoryId: activeCategoryId, activeSectionId: activeSectionId, activeArticleId: activeArticleId, partial: partial }) %> <% if (section.articles.length) { %> <% } %>
• <% }); %>
<% } %>
<% if (sections.length) { %>
<% sections.slice(0, maxSections).forEach(function(section) { %>
• <%= section.name %> <%= partial('partial-section-list-sections', { parent: section, sections: section.sections, maxSections: maxSections, partial: partial }) %>
• <% }); %> <% if (sections.length > maxSections) { %>
• See more
• <% } %>
<% } %>
<% var getColumnClasses = function(numberColumns) { var classNames = numberColumns === 'auto' ? 'col-auto' : 'col-12'; if (numberColumns >= 2) classNames += ' md:col-6'; if (numberColumns >= 3) classNames += ' lg:col-4'; if (numberColumns >= 4) classNames += ' xl:col-3'; return classNames; } %>
<% blocks.forEach(function(block, index) { %>
• <% if (imageHeight) { %> <% } %>
<% if (block.name) { %>

<% if (block.html_url) { %> <%= block.name %> <% } else { %> <%= block.name %> <% } %>

<% } %> <% if (block.description) { %>

<%= block.description %>

<% } %>
• <% }) %>