Hi. How can we help?

Calculating the percentage of total sales by category

After learning about best practices and how to create basic calculations, you can start building compound calculations.

To get started, as an example, if you have a list of sales by category for the year so far, and you want to determine the percentage of sales of each category, you'll need to divide each line by the total sales.

Retail-R-analytics-sales-by-category.png

To determine the percentage of total sales by category:

  1. Create a new calculation.
  2. Enter Sum in the calculator.

    Retail-R-Analytics-sum-of-total.png

  3. Your Sum calculation should be like: sum(${sale_lines.total_sales_no_tax})
  4. Save the calculation, and the Sum of Total column displays in the report.

    Retail-R-analytics-sum-of-total-column.png

  5. Return to Table Calculations and start a second table calculation.

    Retail-R-analytics-sum-of-total-and-new-calculation.png

  6. Prepare the formula by entering the line, a forward slash for dividing, and a set of open and closed brackets.

    Retail-R-analytics-percentage-of-sales-division-brackets.png

  7. Copy and paste the formula from the first calculation inside the second calculation brackets you just entered. The calculation should look like:

    ${sale_lines.total_sales_no_tax}/(sum(${sale_lines.total_sales_no_tax}))

    Retail-R-analytics-percentage-of-total-calculation.png

  8. Save the calculation.
  9. Return to Table Calculations and switch the number formatting to Percentage.
  10. Optionally, enter a new title name.
  11. Optionally, to clean up the report, delete the Sum of total first calculation from the table by clicking the gear icon (Settings) > Remove. This can be deleted because the second calculation's column for the Percentage of total include this information.

    Retail-R-analytics-remove-table-column.png

The final report will display the percentage each line contributes towards the total.

Retail-R-analytics-final-percentage-of-total-sales-by-category-report.png

The calculation doesn't look at the dimensions, so you can replace the dimension of Top Level Category with Employee, Multi-Store location, Customer, or more.

Was this article helpful?

0 out of 0 found this helpful