Hi all,
I am trying to do a weighted average calculation and need to use an IIF statement to do it.
Here is what I have so far:
TotalSum: IIf([Transactions]![Shares]>0,Sum([Price]*[Shares])/Sum([Transactions]![Shares]),+0)
Okay, the first part:
Do the true part of the statement if Shares>0. This signifies a BUY, a negative signifies a SELL or a MOVE.
If True: Add this row to the weighted average calculation. I have tested this part prior to adding the IIF statement and it worked as expected.
If False: Essentially skip the row or do nothing and go onto the next row, but how do I signify this exactly?
Many thanks for the help!
Rob
I am trying to do a weighted average calculation and need to use an IIF statement to do it.
Here is what I have so far:
TotalSum: IIf([Transactions]![Shares]>0,Sum([Price]*[Shares])/Sum([Transactions]![Shares]),+0)
Okay, the first part:
Do the true part of the statement if Shares>0. This signifies a BUY, a negative signifies a SELL or a MOVE.
If True: Add this row to the weighted average calculation. I have tested this part prior to adding the IIF statement and it worked as expected.

If False: Essentially skip the row or do nothing and go onto the next row, but how do I signify this exactly?
Many thanks for the help!
Rob