Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Measure Dimension Help

I am trying to get a total sum of weight.  I created a new measure but, I am still getting an error. 

sum(aggr(sum({$<order_type={'sale'}>}distinct(medicated_weight_base / 1000) * qty_base), order_product_inventory_id),(sum({$<order_type={'sales'}>}distinct(medicated_weight_base / 1000) * qty_base), order_product_inventory_id),(sum({$<order_type={'refund'}>}distinct(medicated_weight_base / 1000) * refunded_qty_base), refunded_order_product_inventory_id))

Anyone see my mistake/error above?

Thanks in advance

1 Reply
dwforest
Specialist II
Specialist II

is qty_base null?

hard to see if there is a mistake without knowing the data model.

a sum of weight, could be as simple as:  sum(medicated_weight_base / 1000 * qty_base).

there seems to be a lot of fields in your aggr, pretty sure you dont want to group your totals by:

(sum({$<order_type={'sales'}>}distinct(medicated_weight_base / 1000) * qty_base), order_product_inventory_id)