Creating Metrics and Reports

This part of the tutorial will guide you through the process of defining metrics and creating reports.

Metrics are numerical values that can be either summarizations of facts or individual numerical records. Metrics ‘summarize’ individual numerical records by aggregating fact values with functions such as SUM (sum), MAX (maximum value), MIN (minimum value), and AVG (mean).

In some cases, attribute values can also be aggregated into metrics. For example, a COUNT of the ‘City’ attribute with the values ‘San Francisco’, ‘Los Angeles’, and ‘New York’ would return 3: SELECT COUNT(CITY)

The query language that that is used to define custom metrics is GoodData’s Multi-dimensional Analytic Query Language (MAQL). For more information about MAQL, see MAQL - Analytical Query Language.

You create reports in the Report Editor. The Report Editor allows you to determine what metrics your report will compute and display and how report metrics will be broken down by attributes that have been selected to categorize and contextualize your data. All reports have at least one metric and typically one or more attributes (except for headline reports). You can also add filters to your reports that determine what data goes into computing your report metrics (for example, only data relating to opportunities that closed in the third quarter of 2012).

Creating a Report and the First Metric

Steps:

  1. Log in to the GoodData Portal, and click Reports on the top of the page. The Reports page opens. The Reports page displays all reports in the project, if any exist. Because this is your first time using the project, no reports are listed yet. 

  2. Click Create Report. The Report Editor opens. 

     

  3. Click What. A pane with all your project metrics opens. Because this is your first time using the project, no metrics are listed yet. You are now going to create a new metric. This metric should count the instances (or values*)* of an attribute called ‘Text’. 

  4. Click Add New Metric. The Simple Metric Editor opens in the right column. 

  5. In the Operation dropdown, select Count.

  6. In the Perform operation on dropdown, select Text. The Text attribute represents the text of individual tweets, so the count of the attribute values returns the number of tweets that have occurred.

  7. Enter the name for the metric, such as ‘# of Tweets’. The metric name helps you and other project users easily find and identify the metric. 

  8. Select the Add to Global Metrics check box. This makes your metric available for use in any reports within the project.

  9. Create a new folder to store the metric in.

  10. (Optional) Click Edit under Default Number Format to change how the metric values are displayed in a report. For more information, see Formatting Numbers in Insights and Reports.

  11. Click Add. The metric is added to your report. Notice that the metric MAQL definition is displayed in the Detail column. 

  12. Click Done. The metric is added to your report and is presented as a single aggregated numerical value, within a single cell in a table. 

Adding More Metrics to the Report

To add additional metrics to your report, click What to open the metric pane, and then click Add New Metric.

Create two more metrics using the SUM operation to aggregate the project facts ‘Retweets’ and ‘Favorites’. Save the metrics globally and be sure to tag them and add them to a folder called ‘Popular Tweet Totals’ or a similar name so that the metrics are easy to discover later.

We recommend that you name these metrics ‘Total Retweets/Favorites’ or ‘Retweets/Favorites [sum]’ to help users understand that this is a sum of a fact rather than a count of an attribute.

In addition to your first COUNT metric, you now have two more metrics:

  • Retweets [sum]
  • Favorites [sum]

Adding an Attribute and a Filter

You can now specify attributes to break down and contextualize your report metrics.

You can also add filters to include or exclude certain subsets of data from your report.

Steps:

  1. Click How. A pane with all your project attributes opens.

  2. In the central column, select the ‘Date (tweet)’ attribute to break down the ‘# of Tweets’ metric that you have added to your report earlier.

  1. Click Done. The report now displays the ‘# of Tweets’, ‘Favorites [Sum]’, ‘Retweets [Sum]’ metrics sliced by the ‘Date (tweet)’ attribute. Notice how the ‘Date (tweet)’ attribute breaks the report data down by day. 

  2. Hover the mouse cursor over the # of Tweets column header. When the downward arrow appears, click it to sort the column values in descending order. This could be useful for correlating social activity around specific marketing activities that occurred on particular dates.

  3. Try other report types: change the report to a bar chart using the Bar chart visualization icon toward the top of the Report Editor. 

  4. Remove the label along the y-axis: click Show Configuration. The configuration pane appears.

  5. Expand the Axis Y options, un-select the check box beside ‘Name’, and click Apply

      For the time being, our report contains relatively few dates and is easy to read. But as the dataset grows, it may become difficult to read all of the data. This is where a filter could come in handy. You can use a filter to limit the data displayed associated with a certain date range, or you could specify that only the data associated with the dates that saw the highest (or lowest) number of tweets should be displayed.

  6. Apply this latter type of advanced filtering to your report: click Filter. The filter pane opens. 

  7. Click Ranking Filter.

  8. For the result size, select the Top option button.

  9. Use the dropdown to select the value ‘10’. This specifies that only the top 10 dates (according to the number of tweets) will be displayed.

  10. For the attribute to rank, select the ‘Date (tweet)’ attribute to rank by date.

  11. For the ranking criteria, select the ‘# of Tweets’ metric. 

  12. Click Apply. The filter settings are applied. You are returned to the report. You are now ready to save the report.

  13. Click Create. A dialog opens, and you are prompted to fill in the report properties.

  14. Name your report so that you and other project users can easily find and identify it later on; for example, ‘Top 10 Tweet Dates’. You can also add a description that will be accessible from the Report Directory and from dashboards where the report appears. Use tags to help others discover your report, or add your report to a folder to better locate it in the future. 

  15. Click Create. The dialog closes. The report is saved and appears in the list of reports on the Reports page. The report is now available for all users of the project. The users can add it to any number of project dashboards.