The technical note game the bases to build the metric I needed.
This example shows how to build a metric that will perform a count based on the result of another metric.
I will use the tutorial project to create a simple example.
Let's say we have the following grid displaying Call Center and Discount %
- Create a new embedded metric (Right click in Report Objects Window select Insert->New metric)
- Add the following formula to the metric: IF(([Discount %] > 0.03), 1, 0)
The formula of the metric has a simple IF statement that outputs a 1 if the condition, in this case "Discount %" metric value is higher than 0.03.
The output of the above metric can be seen here:
If we need a count of the total the metric can be modified to show the total instead of the individual values that meet the condition:
The if condition can also include AND and OR modifiers to increase the logic inside the IF statement.
Let's say we wanted to count "Discount %" under 2.9% and above 3.2% we could rewrite our metric with this formula: IF((([Discount %] < 0.029) Or ([Discount %] > 0.032)), 1, 0)
The metric can be used in a document with a higher level attribute and it will aggregate the values showing a total.




No comments:
Post a Comment