4 Replies Latest reply on Mar 29, 2017 5:31 PM by Deepak Rai

# Price per order

I have order transactions. Some of these have "quantity" = 2 or more. I want to return the average price per transaction. So, for order #1, if  product sales = 10 and quantity=1 then transaction is \$10 and so on. However, I treid this formula below but it's not working. It still returns total transaction dollars (just product sales).

IF [Type]="Order"

THEN

[Product Sales]/[Quantity]

END

• ###### 1. Re: Price per order

This would be an aggregated Calculation.

You have to do like this:

Hope it Helps!!!

Thanks

Deepak

• ###### 2. Re: Price per order

Hi Alex,

IF ATTR([Type])="Order"

THEN

SUM([Product Sales])/SUM([Quantity])

END

• ###### 3. Re: Price per order

Well that part doesn't include the category of just a certain type from a column. Also, why does it work when I do this. It has no problem doing this.

IF [Type]="Order"

THEN

[Product Sales]

END

• ###### 4. Re: Price per order

This one is correct as it is not aggregated. For your previous question, I corrected the formula you can extend it using ELSEIF THEN.

Thanks

Deepak