Creating charts and chart reports

In this tutorial we use a survey for the employment status and income of people. As an example we will create a chart for the number of people who are employed and unemployed. This tutorial shows the basics on how to create a chart, for more advanced charts see additional tutorials.

To create the chart we use the Charts builder which you can access in the menu under the header CHARTS, MAPS and REPORTS. The Charts builder page is shown in figure 1.

 

Figure 1, Charts builder
 
Creating a query with the charts builder

With the charts builder you create data queries for your survey data and the results of the queries are shown in a chart. To create a chart you first define a new empty chart using the table on the top left. Then you create the data queries using the three tables on the right, with this first table you select the questions for which you want to show the results in the chart, the second table defines how you want to group the data and the third table is for setting the conditions. 

In this example we use an income survey whereby we ask an Employment question, in this question you select if the person is employed or unemployed. To create a chart showing the number of people who are employed and unemployed the survey builder needs to create the following database query:

Database query:            SELECT COUNT('Employment') FROM 'database' WHERE 1 GROUP BY 'Employment'

The database query has three parts, the SELECT-part,  the WHERE-part and the GROUP BY-part. The SELECT part is selecting the data we want to show in the chart, in this case we want to count the number of people employed or unemployed. The WHERE part is setting the conditions, used to filter the results, in our example we want to get the employment status for all our survey results, so we do not filter and leave it blank. The GROUP BY part is used to group the results, so instead of returning all the query results as one value, group by will return the results grouped by the results of the GROUP BY question. In this example the GROUP BY question is the Employment question which can have two results, either employed or unemployed. Therefore we will get for count(employment) the results for both employed and unemployed

Add a new chart

The first step in building a chart is to create a new empy chart, to do this click on the plus button in the Survey data charts table on the left, the chart we created was named Employment as can be seen in figure 2.

 

Figure 2, An empty chart was created named Employment

 

Setting the data fields

The next step is to define the questions you want to show in the chart. For this chart we want to show the number of people who are employed and who are unemployed. To to do this click the pencil icon in the first row of the Data fields in survey chart (). We selected the employement questionnaires, the Employed question and the count operation. This will create a chart for the employed question whereby we count the number of people who are employed and not employed.

 

Figure 3, setting the data fields for the Employment chart

 

Group data

After selecting the data field questions we need to define the Group by data. As explained previously, we group by the Employment question so the query will return two results, the number of people employed and unemployed. The query settings are shown in figure 4 and the resulting chart in figure 5.

 

Figure 4, setting the group data value

 

 

 

Figure 5, the resulting chart

 

Creating chart reports

When you are finished creating the charts you can combine them in one report, to do this select Charts from the menu, this will open the charts page as shown in figure 6.

 

Figure 6, combine charts 

 

 

Selecting charts for the charts report

Select from charts data the chart(s) you want to show in this charts report, because we only created one chart we selected only Employment, this is shown in figure 7.

 

Figure 7, the select the Employment chart

 

Save the charts report

To save the charts report click the save report button, this will open the form as shown in figure 8, give the report name and save. The charts can now be accessed through the Data chart report drop down list.

 

Figure 8, Save the chart

 

 

 

 

 

© Denkami 2024 | 18 Kapumpe Rd, Lusaka, Zambia | +260 962 401 869 | admin@denkami.com