Charting query results as a pie chart
You can chart your query results as a pie chart by using QMF Analytics for TSO.
About this task
Pie charts depict the size relationship between the parts to the whole.
For example, staying with the foul weather gear sales example, you might want to use a pie chart to illustrate which months are the wettest and use the chart to explain why you want to increase production of foul-weather gear during those months.
In this example you will query climate data for the USA and create a chart using data from the RAINFALL and MONTH columns of the query result.
- Start QMF for TSO.
Your QMF administrator can tell you how to start a QMF session and give you a user ID. Check with your QMF administrator if you have any questions about getting started with QMF.
- From the QMF Home Panel, enter DISPLAY
Q.CLIMATE_USA on the command line and press Enter.
QMF for TSO displays the query result as a multi-columned report.
- Enter SHOW ANALYTICS on the command line and press Enter to start QMF Analytics for TSO.
- Tab to Pie in the Charts section
of the QMF Analytics for TSO Home
Panel and press Enter.
The Parameter Selection panel is displayed.
- Create the specification for your analysis.
Set your parameters as shown in the following table.
You can enter column names manually or you can tab to the field and press the List function key (F4).
The List function opens a Column Selection window that lists all of the column names from the query result. To select a column from the Column Selection window, tab to the column name and press Enter. QMF Analytics for TSO adds the name to the Parameter Selection panel automatically.
Table 1. Parameter Settings for Pie chart Parameter Setting Specify the column to form the accumulated values for each slice (Y) RAINFALL Specify a column to determine the sector of each slice (X) MONTH Explode Slices? None 3-D Pie Chart? No Chart Title
Enter a title for your chart in the Chart Title field or accept the default value of asterisk (*).
If you accept the default value of asterisk (*), QMF Analytics for TSO creates a title based on the columns that you have selected.
If you delete the asterisk (*) and leave this field blank, the analysis output will not include a title.
- Optional: Press the Save function key (F5)
to save the specification to the QMF database
as an ANALYTIC object. Saving the specification to the database allows you to run your analysis directly from the QMF command line at a later time, without having to navigate to the QMF Analytics for TSO Home panel and reenter the parameters. Saving specifications makes sense if you plan on running the analysis frequently or multiple times.Note: The global variable DSQEC_SESSGLV_SAV in QMF controls how the autosave for parameter settings works. For information about Global Variables, see Global Variable List in the QMF help.
- Press the Run function key (F2) to generate the pie chart.
QMF Analytics for TSO creates the chart.
The chart shows that June and July (month 6 and 7) are the rainiest months. To make this even more clear to your audience, you can accentuate the "slice" associated with the rainiest month.
- Press the End function key to return to the Parameter Selection panel.
- To highlight which month was the rainiest month, set Explode
Largestby tabbing to
Largestand pressing Enter.
- To apply a 3-dimensional effect to the chart, set 3-D
Pie Chart? to
Yesby tabbing to
Yesand pressing Enter.
- Press the Run function key (F2) to generate an updated
version of the pie chart.
QMF Analytics for TSO creates the new pie chart in 3-dimensional format, highlighting the rainiest month
- Optional: If you have configured print capabilities in QMF, you can print the chart.
- Press the End function key (F3) to return to the Parameter Selection panel.
- Press the End function key (F3) to return to the QMF Analytics for TSO Home panel.