iif statements...the drama!!!!

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

Guest

I am setting this up in a report.

=IIf([Prod Cat]="PE",Sum([SumOfAssets Under MGMT])-[SumOfAssets Under MGMT],0)

I have two problems occuring:
1. the calculations will subtract the "PE" Prod Cat amount but how do I make
it add it if there is no "PE" within the category.
2. The other problem I've encountered is if the "PE" is in the middle of
the list it will not calculate it at all.

I know I am so close but I am burn't out...Can anyone help my cause?

Sarita
 
I had a couple of questions myself:

1) You mean to be summing a field that already appears to be summing?
There's only one field in your sum function.
2) If Prod Cat does not equal PE, it's returning a 0. What is it that you
want it to do instead?
 
Is that it?

=[SumOfAssets Under MGMT] + ([Prod Cat amount] * IIf(Pos([Prod
Cat],"PE")<>0),-1,1))

the thing is... if you have a Category like APE, it will understand as PE is
there so, you may want to ajust it to your list

If "PE" is present, it will choose +1 or -1, performing the operation

Change [Prod Cat amount] for the correct name of your field

Mauricio Silva
 
I figured out the problem!!!...I am looking for a specific number with a
category and subtracting it from the total sum. I had to remove the ", o" at
the end of the statement in order for it to work.

Thank you.
 
Back
Top