If you want to compare the annual sales figures of your products for the past 10 years, you would need a way to summarize all the data. A boxplot is an efficient chart type to summarize large amounts of data. A boxplot displays the range and distribution of data along a number line. The following illustration will help you further in reading this chart.
Data Workshop
Execute the following steps to create a table for this exercise and
populate it with relevant data:
1. Access
the Data Load/Unload page by clicking SQL Workshop | Utilities | Data
Workshop.
2. Click
the Load Data button on the Data Workshop page.
3. On
the Upload a File tab, click the Choose File button and select School_Stats.csv file from the book
code folder. Alternatively, drag and drop the file in the marked area.
4. On
the Load Data page, select New Table for Load To,
and enter BoxPlot_Table for Table Name. Click the Load Data button. After a while you
will see "Table BOXPLOT_TABLE
created with 15 rows!" message. Click the View Table button to browse the table.
Note that when you create table and upload data in one go using this approach, the process automatically generates the primary key for the table.
Create Single Series Box Plot Chart
1. Click
Create Page in the main Application Builder interface.
2. Select
the Chart option.
3. On Chart Type
screen, choose Box Plot.
4. Enter the following details for the new page and then click Next.
5. On
the Source screen, choose SQL Query
for Source Type,
and enter the following query in the SQL Query box. After entering the query, click Next.
Select course, schoola from boxplot_table
6. On Column Mapping page, accept the Vertical Orientation, set Label Column to COURSE, Value Column to SCHOOLA and click Create.
7. In
Page Designer, click
the Box Plot Chart region, set its Title to Single
Series Box Plot Chart and change the default Series name from Series 1 to School A.
8. Save
the page and run it from the Reports menu. Hover your mouse pointer over each
box to see the values.
Create Multi-Series Box Plot Chart
This box plot chart will compare the marks of all three schools using
multiple series.
1. In Page Designer,
right click the Components node and select Create Region. Set the following parameters for the new region:
Property |
Value |
Title |
Multi-Series Box Plot Chart |
Type |
Chart |
Location |
Local Database |
Type |
SQL Query |
SQL Query |
select * from boxplot_table |
Type (under Attributes) |
Box Plot |
Show (under
Legend) |
On |
2. Click on the New node under Series, and set the following
attributes:
Property |
Value |
Name |
School A |
Location (under Source) |
Region Source |
Label |
COURSE |
Value |
SCHOOLA |
3. Right click the Series node
and select Create Series to add
another series. Set the following attributes for this series:
Property |
Value |
Name |
School B |
Location (under Source) |
Region Source |
Label |
COURSE |
Value |
SCHOOLB |
4. Create the final series for School C, as follows:
Property |
Value |
Name |
School C |
Location (under Source) |
Region Source |
Label |
COURSE |
Value |
SCHOOLC |
Save and run the page to see the multi-series Box Plot chart, as illustrated in the
following figure.