It's common to require a metric that simply gives a count of the number of rows, or a distinct count of a particular value within a subject.
For instance. I have a subject that contains test drive bookings for a car dealership, and want a chart that shows the number of bookings per week. We could achieve this by creating a new metric, called number of bookings, that simply reflected the number of rows in any given grouping. There is a detailed explanation on how to create a count metric in your subject here.
In another example, I have a subject that contains sales details from a retail application. Each transaction can be represented by multiple rows, one for each product included in the transaction. We want a chart that shows the number of transactions per week. To achieve this, we can add a new metric, called number of transactions, that shows the distinct count of the column Transaction ID in any given grouping. There is a detailed explanation on how to create a distinct count metric in your subject here.
Creating a count metric
Follow these steps to add a count metric to your subject:
- Click on the user menu in the top right on the inmydata home screen, and select Settings
- Select Subjects in the tabs on the left, and select the subject you wish to edit.
- Select the subject you wish to add the count metric to, and select the edit icon
- In the Columns tab, press the add metric button
- Select the option a count of rows or unique values from the first drop down list
- Enter a unique name for your new column
- Select the number of rows as the option to count
- Press OK in each screen to accept and save your changes,
Creating a distinct count metric
Follow these steps to add a distinct count metric to your subject:
- Click on the user menu in the top right on the inmydata home screen, and select Settings
- Select Subjects in the tabs on the left, and select the subject you wish to edit.
- Select the subject you wish to add the count metric to, and select the edit icon
- In the Columns tab, press the add metric button
- Select the option a count of rows or unique values from the first drop down list
- Enter a unique name for your new column
- Select the unique values in one or more columns as the option to count
- For each column that should be included in the distinct value calculation, press the add button, select the column and press OK
- Press OK in each screen to accept and save your changes,