Common Calculated Columns
Column Name | Description |
---|---|
Customer's first 30 day revenue | Sum total of revenue for all orders placed by this customer within 30 days of the customer’s first order date. Calculated by joining customer_entity.entity_id to sales_order.customer_id and summing the base_grand_total field for all orders where sales_order.Seconds between customer's first order date and this order ≤ 2592000, which is the number of seconds in 30 days |
Customer's first order date | Timestamp of the first order placed by this customer. Calculated by joining customer_entity.entity_id to sales_order.customer_id and returning the minimum sales_order .created_at value |
Customer's first order's billing region | Billing region associated with the customer’s first order. Calculated by joining customer_entity.entity_id to sales_order.customer_id and returning the Billing address region where sales_order.Customer's order number = 1 |
Customer's first order's coupon_code | Coupon code associated with the customer’s first order. Calculated by joining customer_entity.entity_id to sales_order.customer_id and returning the sales_order.coupon_code where sales_order.Customer's order number = 1 |
Customer's group code | Group name of the registered customer. Calculated by joining customer_entity.group_id to customer_group .customer_group_id and returning the customer_group_code field |
Customer's lifetime number of coupons | Total number of coupons applied to all orders placed by this customer. Calculated by joining customer_entity.entity_id to sales_order.customer_id and counting the number of orders where the sales_order.coupon_code is not NULL |
Customer's lifetime number of orders | Total count of orders placed by this customer. Calculated by joining customer_entity.entity_id to sales_order.customer_id and counting the number of rows in the sales_order table |
Customer's lifetime revenue | Sum total of revenue for all orders placed by this customer. Calculated by joining customer_entity.entity_id to sales_order.customer_id and summing the base_grand_total field for all orders placed by this customer |
Seconds since customer's first order date | Elapsed time between the customer’s first order date and now. Calculated by subtracting Customer's first order date from the server timestamp at the time the query is executed, returned as an integer number of seconds |
Store name | The name of the Commerce store associated with this registered account. Calculated by joining customer_entity.store_id to store.store_id and returning the name field |