how to perform a calculation where two operations are needed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have to perform to different operations on the same set of data based on a
criterion.
Here is my example:
Balance Amount TransactionType
500 25 1
350 300 2

If the TransactionType is 1 we should add the (balance+Amount) however if
the transactionType is 2 we need to subtract.
How do we achieve this?
 
Try

NewFieldName: IIf([TransactionType]=1, [balance]+[Amount], [balance]-[Amount])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top