In certain scenarios, it is necessary to count the number of unique attribute elements that appear in a column.
In certain scenarios, it is necessary to count the number of unique attribute elements that appear in a column. The steps below show how to achieve this in Strategy Desktop 9.x.
Consider a scenario where an attribute contains a list of Y’s and N’s as show below:
Create a metric based off this attribute defined as the maximum value of the attribute's description as shown below:
Create a subtotal to count the number of Y's. This formula uses an IF statement saying if the Flag Metric is Y, return 1, otherwise return 0. The number of 1's is summed to get the count.
Create a subtotal to count the number of N's. This formula uses an IF statement saying if the Flag Metric is N, return 1, otherwise return 0. The number of 1's is summed to get the count. >
Ceate a copy of the Flag Test Metric so no recursive definitions exist and enable custom subtotals for this metric. To do this, edit the subtotal> subtotals/aggregation tab> Total subtotal function> More> Add Count N's and Count Y's subtotals. Move these subtotals from Project Subtotals to Available Subtotals for metric.
Put this metric on a report and enable subtotals. To do this data> subtotals> select Count N's and Count Y's. Execute. >