# Inventory

{% hint style="warning" %}

#### Workshop - Inventory

While report-based dashboards excel at combining existing reports, query-based dashboards offer a different approach that provides maximum flexibility and control over your data visualization. In this workshop, you'll learn to build dashboards from the ground up using Dashboard Designer's integrated query tools, creating custom data tables and charts without the need for pre-existing reports. This approach is ideal when you need specific data views that don't already exist in your reporting environment or when you want to rapidly prototype dashboard content directly from your data sources.

In this hands-on workshop, you'll experience the query-based dashboard development workflow, learning to connect directly to data sources and build visualizations through the visual query designer. You'll discover how to construct metadata queries that select, filter, and sort data to meet specific business requirements, then transform those queries into both tabular and graphical components. You'll master the essential techniques for creating data tables that display detailed inventory information and charts that visualize relationships between key metrics. This approach gives you complete control over every aspect of your dashboard content, from the SQL logic that retrieves the data to the final presentation of charts and tables.

**What You'll Accomplish:**

* Select and configure dashboard layout templates (2 Column) and themes (Crystal) for visual presentation
* Set dashboard properties including title (Inventory Dashboard)
* Connect to the Inventory data source using the metadata layer
* Build a data table component by constructing a metadata query that selects Product Line, Product Name, Quantity in Stock, and MSRP
* Apply sorting (ascending by Product Line) to organize tabular data logically
* Configure data table properties and apply custom titles (Inventory Table)
* Create a chart component using the same Inventory data source with a new query
* Implement query filters by adding conditions (Product Line begins with "M") to focus on specific data subsets
* Design a chart using the Chart Designer by mapping columns to chart elements (Series, Category, Values)
* Configure chart properties including chart title, axis labels, and visual presentation

By the end of this workshop, you'll have created a functional query-based dashboard that demonstrates the power and flexibility of building content directly from data sources. You'll understand when to choose query-based dashboards over report-based approaches, recognizing that this pattern excels when you need custom visualizations, rapid prototyping capabilities, or specific data views that don't warrant creating full reports. You'll have gained experience with the metadata query designer, understanding how to select columns, apply conditions, and transform query results into meaningful visualizations.

**Prerequisites:** Pentaho Business Analytics Server with Inventory metadata data source configured\
**Estimated Time:** 25-30 minutes
{% endhint %}

<figure><img src="/files/j19Svi2aF88Y2Qh86WeA" alt=""><figcaption><p>Inventory Dashboard</p></figcaption></figure>

{% tabs %}
{% tab title="Template & Data Source" %}
{% hint style="info" %}

#### Dashboard Templates

Creating a dashboard in Dashboard Designer is as simple as choosing a layout template, theme, and the content you want to display.
{% endhint %}

<figure><img src="/files/YFnB0m82FUiWdWpsFb3C" alt=""><figcaption><p>Template - 2 column</p></figcaption></figure>

1. From the User Console Home Perspective, click Create New -> Dashboard.
2. On the Templates tab, click 2 Column.
3. On the Themes tab, select Crystal.
4. Click the Properties tab, and Enter: Inventory Dashboard as the title.
5. In the Untitled 1 header, click Insert Content, and then click Data Table.
6. From the Select Data Source dialog, click Inventory, and then click OK.

<figure><img src="/files/9iUTl2bjXQTrZTVFUbw6" alt=""><figcaption><p>Inventory - data source</p></figcaption></figure>
{% endtab %}

{% tab title="Content" %}
{% hint style="info" %}

{% endhint %}

#### Data Table

<figure><img src="/files/wf2EXnoYMZYPT0DtoOxt" alt=""><figcaption><p>Product Queries</p></figcaption></figure>

1. Add Product Line to the Selected Columns:

&#x20;      • From the Categories/Columns list, expand Products.

&#x20;      • Click Product Line.

&#x20;      • Click the top arrow to move Product Line to the Selected Columns area.

2. Repeat the previous step to add Products -> Product Name, Inventory and Cost > Quantity In Stock, and Inventory and Cost -> MSRP to the Selected Columns area.
3. To ASC Sort by Product Line and create the table:

&#x20;      • From the Categories/Columns list, click Product Line.

&#x20;      • Click the bottom arrow to move Product Line to the Order By area.

&#x20;      • Click OK.

4. In the Title text box, type Inventory Table, and then click Apply.

<figure><img src="/files/DkhsdMvvihPr4LRaCX0V" alt=""><figcaption><p>Inventory Table</p></figcaption></figure>

***

#### Chart

{% hint style="info" %}

{% endhint %}

1. In the Untitled 2 header, click Insert Content, and then click Chart.
2. From the Select Data Source dialog, click Inventory, and then click OK.

<figure><img src="/files/9ZCRGoiUkpaUn2TZ63Ct" alt=""><figcaption><p>Condition: Product Line begins with M</p></figcaption></figure>

3. Add columns to the Selected Columns:

&#x20;      • From the Categories/Columns list expand Products.

&#x20;      • Click Product Line.

&#x20;      • Click the top arrow to move Product Line to the Selected Columns area.

&#x20;      • Expand Inventory and Cost.

&#x20;      • Click Quantity in Stock.

&#x20;      • Click the top arrow to move Quantity in Stock to the Selected Columns area.

&#x20;      • Click MSRP.

&#x20;      • Click the top arrow to move MSRP to the Selected Columns area.

4. Add a condition for Product Line and open the Chart Designer:

&#x20;      • From the Categories/Columns list, click Product Line.

&#x20;      • Click the middle arrow to move Product Line to the Conditions area.

&#x20;      • From the Comparison drop-down list, select begins with.

&#x20;      • In the Value column, type M.

&#x20;      • Click OK.

5. To create the chart, complete the following fields in the Chart Designer window, and then click OK:

<figure><img src="/files/oFLN0UULXMZC7mD2OcaV" alt=""><figcaption><p>Chart</p></figcaption></figure>

| Field           | Entry             |
| --------------- | ----------------- |
| Series Column   | Product Line      |
| Category Column | Quantity in Stock |
| Values Column   | MSRP              |
| Chart Title     | Inventory         |
| X Axis Title    | Qty               |
| Y Axis Title    | MSRP              |
| {% endtab %}    |                   |
| {% endtabs %}   |                   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.pentaho.com/pentaho-business-analytics/business-analytics/dashboard-designer/inventory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
