Previously, we saw how to create a report for
Top N Items in Each Category
. Now let's see how to do comparative analysis along with top values with the following reports as examples.
This report ranks the customers whose invoices have grown in comparison with the previous month. This helps you identify customers who tend to purchase more from you and also the customers who will purchase less.
Let's see how to create the above report.
Create the following Aggregate formulas by clicking Add > Aggregate Formula to get the required data.
The following formula gives you the current month sales.
Current Month Sales
sum(if(absmonth( "Sales"."Date" ) = absmonth(today()), "Sales"."Sales ", 0 )) |
The following formula gives you the previous month sales.
sum(if(absmonth( "Sales"."Date" ) = absmonth(add_month(today(), -1)), "Sales"."Sales ", 0 )) |
Now compare the current and previous month sales using the following formula, which gives the difference between current and previous month sales.
"Sales"."Previous Month Sales" - "Sales"."Current Month Sales" |
Add an aggregate formula to rank the sales in ascending order. From this, you can get the botton N items by sales.
Rank( "Sales"."Sales Diff Previous Month" ,' asc ') |
Have another aggregate formula to rank sales in descending order to get the top N items by sales.
Rank( "Sales"."Sales Diff Previous Month" ,' desc ') |
Now, the necessary reports can be created using the above aggregate formulas.
As the second example, let us see how to create a report that compares each value against the top value. For example, comparing each sales person's sales with the top performing sales person's sales.
Find the Top Sales
First(Sum( "Store Sales"."Sales" )) |
The above formula will calculate sales for the dimension in your report (Region, in this example) and return the top value for each section.
The above report displays the top sales made by the salespersons in each region.
Calculating Sales in Percentage against Top Sales
Now you can calculate the Sales in Percentage against Top Sales using the Report Formula. To invoke the Report Formula dialog, click the highlighted icon.
Use the below formula to calculate the Sales in Percentage against Top Sales.
( "1. Sales" / "2. Top Sales" )* 100 |
A report will be generated.
Hide the Totals using the Show/Hide button and customize the Theme as needed.