Skip to content

Redwood Update - Easily Build Powerful Analytic Applications using APEX and Analytic Views #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 79 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
2e132bf
Fixing manifest
william-endress Jan 25, 2023
22483f0
Test
william-endress Jan 25, 2023
5475a76
Final draft for review
william-endress Jan 30, 2023
e0dcb0c
Corrections
william-endress Jan 31, 2023
ce291a1
Update 3-create-user.md
william-endress Jan 31, 2023
e0ae81e
Update manifest.json
william-endress Jan 31, 2023
e739467
Update manifest.json
william-endress Jan 31, 2023
42589c8
Update images
william-endress Jan 31, 2023
2daca6e
Updates after Mike's review
william-endress Feb 1, 2023
0add478
Update 14-learn-more.md
william-endress Feb 1, 2023
ab55c27
Fixed broken link
william-endress Feb 2, 2023
8b29061
Moved Into to first topic
william-endress Feb 2, 2023
f9dc106
Update 14-learn-more.md
william-endress Feb 2, 2023
f503ef3
Misc Self QA fixes
william-endress Feb 2, 2023
3e3f6da
Fixes
william-endress Feb 2, 2023
a704359
Update 0-introduction.md
william-endress Feb 2, 2023
c184ec1
Update 0-introduction.md
william-endress Feb 3, 2023
846d88d
Update manifest.json
william-endress Feb 3, 2023
e948828
Update 0-introduction.md
william-endress Feb 6, 2023
d8fb4be
Changed month of publication
william-endress Feb 6, 2023
58d2f49
Minor edit
william-endress Feb 6, 2023
9ace1a1
Update 2-open-sql-worksheet.md
william-endress Feb 6, 2023
495be50
Update 4-install-sample-data.md
william-endress Feb 7, 2023
5bab6df
Update 4-install-sample-data.md
william-endress Feb 8, 2023
2609157
Update folder structure
william-endress Feb 10, 2023
4e63e4d
Fix filename urls
william-endress Feb 13, 2023
ee2ebb7
fixes
william-endress Feb 13, 2023
3d79fb9
Fixed file URLs
william-endress Feb 15, 2023
497373e
Update manifest.json
william-endress Feb 15, 2023
8d9d566
Updated sample data urls
william-endress Feb 16, 2023
5ecd973
Merge remote-tracking branch 'upstream/main'
william-endress Feb 16, 2023
7067d7e
Merge remote-tracking branch 'upstream/main'
william-endress Feb 17, 2023
6d09967
Update manifest.json
william-endress Feb 17, 2023
7fb61b7
Update Overview Manifest to Original
william-endress Feb 17, 2023
240c297
Fixes as requested by LiveLabs team
william-endress Feb 24, 2023
0a2ad0e
Update 10-deploy-av.md
william-endress Feb 24, 2023
2a56f53
Merge remote-tracking branch 'upstream/main'
william-endress Feb 24, 2023
1c8fe36
Merge remote-tracking branch 'upstream/main'
william-endress Apr 20, 2023
a882eb3
Merge remote-tracking branch 'upstream/main'
william-endress May 16, 2023
b6c610f
First commit
william-endress May 16, 2023
f887f2a
Update 6-explore-tables.md
william-endress May 16, 2023
839763b
Update 0-introduction.md
william-endress May 18, 2023
0ec609d
Create 2-start-sql-worksheet.png
william-endress May 18, 2023
6e9e2cf
Image updates
william-endress May 18, 2023
9882928
Misc edits
william-endress May 18, 2023
e023703
Misc edits
william-endress May 18, 2023
1bf6118
Update 2-open-sql-worksheet.md
william-endress May 23, 2023
fdc80d5
Update 2-open-sql-worksheet.md
william-endress May 23, 2023
6ec2324
Update 2-open-sql-worksheet.md
william-endress May 23, 2023
38d9294
Merge remote-tracking branch 'upstream/main'
william-endress May 23, 2023
e336010
Fixes
william-endress May 23, 2023
aa054d3
Post QA Updates
william-endress May 25, 2023
44c2c80
Merge remote-tracking branch 'upstream/main'
william-endress May 25, 2023
b5d3ab9
Fixes
william-endress May 26, 2023
c96962c
Fixes
william-endress May 26, 2023
5a1159c
Fixes
william-endress May 26, 2023
a8bac5c
Fixes
william-endress May 26, 2023
562fc9f
Fixes
william-endress May 26, 2023
6326608
Update directory structure
william-endress Jun 5, 2023
be21107
link fix
william-endress Jun 20, 2023
d0fd9d8
Merge remote-tracking branch 'upstream/main'
william-endress Jun 21, 2023
15d398c
Fixes
william-endress Jun 29, 2023
7912020
Merge remote-tracking branch 'upstream/main'
william-endress Jun 29, 2023
26cb144
Update manifests for CW
william-endress Jul 24, 2023
08d1fba
Merge remote-tracking branch 'upstream/main'
william-endress Jul 24, 2023
385d428
Merge remote-tracking branch 'upstream/main'
william-endress Aug 17, 2023
b43ce72
11395
william-endress Aug 17, 2023
00bdaad
Merge branch 'oracle-livelabs:main' into main
william-endress May 15, 2024
0970ad4
Image updates for ORDS 24.1.1
william-endress May 15, 2024
7e368da
Update for ORDS 24.1.1
william-endress May 15, 2024
5dd0768
Fixes to directory structures
william-endress May 15, 2024
6346b61
Fix minor typos
william-endress May 16, 2024
b548b22
Merge remote-tracking branch 'upstream/main'
william-endress May 16, 2024
9341b3f
Fix Last Updated
william-endress May 16, 2024
61b3bb7
Merge branch 'oracle-livelabs:main' into main
william-endress May 1, 2025
0427df6
Annual update
william-endress Jun 26, 2025
51e63ae
Merge branch 'oracle-livelabs:main' into main
william-endress Jun 26, 2025
2777a0c
Update for Redwood
william-endress Jun 27, 2025
68845d0
Refresh text
william-endress Jun 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,36 @@

## Introduction

Every APEX region needs a data source. You will add queries that select from your analytic view as the data source for each chart. You will configure your charts as:
Each APEX region needs a data source. In this lab, you’ll connect each chart to a SQL query that selects from the analytic view. You’ll configure four charts:

- Sales by time.
- Sales change from prior period by time
- Sales percent change from same period one year ago by geography.
- Sales share of search genre.
- Sales by time
- Sales change from prior period
- Sales percent change year-over-year by geography
- Sales share of search genre

You will start by creating static graphs. In the next lab you will add interactive data selections.
This lab sets up static charts. Interactivity will be added in the next lab.

Estimated Time: 20 minutes.
**Estimated Time:** 20 minutes

### Objectives

In this lab, you will:
- Use simple query templates from the analytic view as data sources in APEX charts

- Learn how simple query templates that select from the analytic view make it very easy to provide data sources to APEX regions.

### Prerequisites:
### Prerequisites

- Complete the previous lab.

## Task 1 - Provide a Data Source to the Sales Chart

In this task, you will add a SQL Query as the Source to the Sales by Time chart.

1. Select the **Sales Dashboard** page in the APEX App Builder.
1. Select the **Sales** chart.
1. For the chart's **Source** choose:
- **Location: Local Database**
- **Type: SQL Query**
- Enter the following **SQL Query**.

This query selects sales at the Month level.
Connect the **Sales** chart to a query showing sales at the Month level.

1. Open **Sales Dashboard** in APEX App Builder
2. Select the **Sales** chart
3. Set **Source** to:
- Location: `Local Database`
- Type: `SQL Query`
- Query:

~~~SQL
<copy>
SELECT
Expand All @@ -55,38 +51,26 @@ ORDER BY
</copy>
~~~

Feel free to set any other attributes according to your preferences.

Next, map the series to the data source.

4. Select **Series 1** within this chart.
4. For the series **Source** choose **Location: Region Source**.
4. Set Column Mappings
- Label: **TIME**
- Value: **SALES**

To ensure that all time periods will be displayed:

7. In the **Performance** section set the **Maximum Rows to Process** to **1000**.
4. Configure **Series 1**:
- Source: `Region Source`
- Label: `TIME`
- Value: `SALES`

View the result:

8. **Run** the page.
5. In **Performance**, set **Maximum Rows to Process** to `1000`
6. Click **Run** to view the chart

![Sales Chart](images/sales-chart.png)

## Task 2 - Provide a Data Source to the Sales Change Prior Period Chart

In this task, you will add a SQL Query as the Source to the Sales by Time chart.

1. Select the **Sales Dashboard** page in the APEX App Builder.
1. Select the **Sales Change Prior Period** chart.
1. For the chart's **Source** choose:
- **Location: Local Database**
- **Type: SQL Query**
- Enter the following **SQL Query**.
Connect the **Sales Change Prior Period** chart using a calculated measure at the Month level.

This query selects sales change from the prior period at the Month level. This query uses the USING form of the FROM clause and includes a calculated measure.
1. Open **Sales Dashboard**
2. Select the **Sales Change Prior Period** chart
3. Set **Source** to:
- Location: `Local Database`
- Type: `SQL Query`
- Query:

~~~SQL
<copy>
Expand All @@ -110,38 +94,26 @@ ORDER BY
</copy>
~~~

Feel free to set any other attributes according to your preferences.

Next, map the series to the data source.

4. Select **Series 1** within this chart.
4. For the series **Source** choose **Location: Region Source**.
4. Set Column Mappings
- Label: **TIME**
- Value: **SALES\_CHG\_PRIOR_PERIOD**

To ensure that all time periods will be displayed:

7. In the **Performance** section set the **Maximum Rows to Process** to **1000**.

View the result:
4. Configure **Series 1**:
- Source: `Region Source`
- Label: `TIME`
- Value: `SALES_CHG_PRIOR_PERIOD`

8. **Run** the page.
5. Set **Maximum Rows to Process** to `1000`
6. Click **Run** to view the chart

![Sales Change Prior Chart](images/sales-change-prior-period-chart.png)

## Task 3 - Provide a Data Source to the Sales Percent Change Year Ago Chart

In this task, you will add a SQL Query as the Source to the Sales by Time chart.
Use a query with percent change compared to the same period last year, grouped by continent.

1. Select the **Sales Dashboard** page in the APEX App Builder.
1. Select the **Sales Percent Change Year Ago** chart.
1. For the chart's **Source** choose:
- **Location: Local Database**
- **Type: SQL Query**
- Enter the following **SQL Query**.

This query selects percent change in sales from the same period one year ago at the continent level. This query uses the USING form of the FROM clause and includes a calculated measure.
1. Open **Sales Dashboard**
2. Select the **Sales Percent Change Year Ago** chart
3. Set **Source** to:
- Location: `Local Database`
- Type: `SQL Query`
- Query:

~~~SQL
<copy>
Expand Down Expand Up @@ -169,45 +141,29 @@ ORDER BY
</copy>
~~~

Feel free to set any other attributes according to your preferences.

Next, map the series to the data source.

4. Select **Series 1** within this chart.
4. For the series **Source** choose **Location: Region Source**.
4. Set Column Mappings.
- Label: **GEGRAPHY**
- Value: **SALES\_PCT\_CHG\_YEAR\_AGO**

To ensure that all time periods will be displayed:

7. In the **Performance** section set the **Maximum Rows to Process** to **1000**.

Format the y-axis.

8. Select **y** axis.
8. In **Value** section, set:
- **Format** to **Decimal**.
- **Decimal Places** to **2**.
4. Configure **Series 1**:
- Source: `Region Source`
- Label: `GEOGRAPHY`
- Value: `SALES_PCT_CHG_YEAR_AGO`

View the result:

10. **Run** the page.
5. Set **Maximum Rows to Process** to `1000`
6. Configure the **y-axis**:
- Format: `Decimal`
- Decimal Places: `2`
7. Click **Run** to view the chart

![Sales Percent Change Year Ago](images/sales-percent-change-year-ago.png)

## Task 4 - Provide a Data Source to the Sales Share of Genre Chart

In this task, you will add a SQL Query as the Source to the Sales Share of Genre chart.

1. Select the **Sales Dashboard** page in the APEX App Builder.
1. Select the **Sales Share of Genre** chart.
1. For the chart's **Source** choose:
- **Location: Local Database**
- **Type: SQL Query**
- Enter the following **SQL Query**.
This chart displays each genre’s share of total sales in 2023.

Sales Share of Genre is the ratio of sales for the current genre to the sales of all genre. This query selects sales share of genre for year 2023.
1. Open **Sales Dashboard**
2. Select the **Sales Share of Genre** chart
3. Set **Source** to:
- Location: `Local Database`
- Type: `SQL Query`
- Query:

~~~SQL
<copy>
Expand All @@ -234,46 +190,31 @@ ORDER BY sales_share_genre;
</copy>
~~~

Feel free to set any other attributes according to your preferences.

Next, map the series to the data source.

4. Select **Series 1** within this chart.
4. For the series **Source** choose **Location: Region Source**.
4. Set Column Mappings
- Label: **GENRE**
- Value: **SALES\_SHARE\_GENRE**

Format the y-axis.

7. Select **y** axis.
7. In **Value** section, set:
- **Format** to **Decimal**.
- **Decimal Places** to **2**.

View the result:
4. Configure **Series 1**:
- Source: `Region Source`
- Label: `GENRE`
- Value: `SALES_SHARE_GENRE`

9. **Run** the page.
5. Configure the **y-axis**:
- Format: `Decimal`
- Decimal Places: `2`
6. Click **Run** to view the chart

![Sales Share of Genre](images/sales-share-of-genre.png)

## Summary

In this lab you created four charts and in interactive grid. The query for each chart and the report selects from the analytic view using the same query template, with calculated measures added using the ADD MEASURES clause.
You created four charts and configured each to use a SQL query that selects from an analytic view. Each query reused a shared pattern, with calculated measures added using `ADD MEASURES`.

You may now **proceed to the next lab**.

## Acknowledgements

- Created By/Date - William (Bud) Endress, Product Manager, Autonomous Database, June 2023
- Last Updated By - William (Bud) Endress, May 2024
- **Created By** - William (Bud) Endress, Product Manager, Autonomous Database, June 2023
- **Last Updated By** - William (Bud) Endress, June 2025

Data about movies in this workshop were sourced from **Wikipedia**.

Copyright (C) Oracle Corporation.
Copyright (C) Oracle Corporation.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled [GNU Free Documentation License](files/gnu-free-documentation-license.txt)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled [GNU Free Documentation License](files/gnu-free-documentation-license.txt)
Loading