Calculate value of all sold items

Published November 17, 2021
Modules
Difficulty
Selected Clients
sharafdg logo

You can calculate the value of sold items including items sold by weight and volume. It helps you analyze the sold products statistics in more effective way.

Prerequisites


Process


In this use case, you will go through the following steps:

  1. Create an expression that will be available as a variable when including the product.buy event in analytics.
  2. Create a metric that calculates all sold items.

Create an expression


In this part of the process, create an expression that will be available as a variable when including the product.buy event in analytics. The formula of the expression multiplies the quantity of the item by the price of a single item.

  1. Go to Analytics icon Analytics > Expressions > New expression.
  2. Enter the name of the expression.
    Note: The name of the expression is also used as the name of the event’s parameter.
  3. As a type of expression, select Event.
  4. From the Choose event dropdown, select the product.buy event.
  5. In the Formula definition section of the page, click Select.
    Result: A dropdown list appears.
  6. From the dropdown list, select Event attribute.
  7. Open the settings of the event attribute by clicking the unnamed expression element that appeared.
  8. From the Choose parameter dropdown, select $finalUnitPrice.
  9. Next to the added event attribute, click the plus button.
    Result: A dropdown list appears.
  10. From the dropdown list, select Event attribute.
  11. Open the settings of the event attribute by clicking the unnamed expression element that appeared.
  12. From the Choose parameter dropdown, select $quantity.
  13. Click the mathematical operator between the attributes and change it to multiplication.
  14. Click Save.
The final form of an expression
The final form of an expression

Create a metric


In this part of the process, create a metric that calculates all sold items. The metric reuses the expression you created in the previous part of the process.

  1. Go to Analytics icon Analytics > Metrics > New metric.
  2. Enter the name of the metric.
  3. As a metric kind, select Simple metric.
  4. As the aggregator, set Sum.
  5. As the occurrence type, set All.
  6. From the Choose event dropdown list, select product.buy.
  7. Click where icon button.
    Result: The Choose parameter button appears.
  8. Click the Choose parameter button.
    Result: A pop-up appears.
  9. On the pop-up, click the three-dot button.
    Result: A dropdown shows.
  10. From the dropdown, select Expressions.
  11. In the list of expressions, find the event expression you have created earlier.
  12. To select a specific time range, click the calendar icon. In our case it will be Lifetime. Confirm your choice with the Apply button.
  13. Click Save.
The final form of a metric
The final form of a metric

What’s next


You can reuse the expression and metric while preparing the analyses to calculate items purchased in a given campaign. You can find more instructions here.

Check the use case set up on the Synerise Demo workspace


Check the expression and metric settings directly in Synerise Demo workspace.

If you don’t have access to the Synerise demo workspace, please leave your contact details in this form, and our representative will contact you shortly.

Read more


😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker