Common Calculated Columns

Column NameDescription
Customer's first 30 day revenueSum 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 dateTimestamp 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 regionBilling 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_codeCoupon 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 codeGroup 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 couponsTotal 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 ordersTotal 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 revenueSum 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 dateElapsed 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 nameThe 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