Creating master measures

A measure is used to define an expression to aggregate data in the visualization. In the charts we have created so far, under the My first charts sheet, we have the following SalesAmount field defined as the chart measure.

The following steps depict how to create a master measure:

  1. If we are in view mode, switch to edit mode using the Edit button. 
  2. Click on the Master items button to open the Master item pane.
  3. Click on the Measure pane to expand it.
  4. Click on the Create new button in the Measure pane to create a new measure.
  5. In the Measure editor panel, click on the fx icon to expand the expression editor.
  6. Write the expression and sum (SalesAmount) into the editor.
  7. Click on the Apply button to close the expression editor.
  8. Write Sales $ in the Name field.
  9. To define a default color for the measure, use the color combo box to open the color picker and select the dark green color, which has the hex code #276e27.
  1. Click outside the color picker to close and return to the measure editor panel, as shown in the following screenshot:

  1. The Create button at the bottom of the screen can be used to create the measure in the Master library.
  1. Repeat the aforementioned steps to create the following measure. Each expression is defined in the code block as follows:
    • Measure name: Avg Discount %
num (sum (Discount*SalesAmount)/sum (SalesAmount), '0.00%')
    • Measure nameOrder #
count (distinct OrderID)
    • Measure name: Quantity #
sum (Quantity)

For each measure, the other properties will be set to their defaults.

The master measures created here will be used in Chapter 7, Creating Data Stories.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset