iif statements...the drama!!!!

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
 
G

Guest

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?
 
G

Guest

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
 
G

Guest

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.
 

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

Similar Threads

adding iif statements 6
IIF function in Report Footer 5
Using iif Null and 0 5
Iif Statements 1
IIF statement to calculate 3
Trouble switching syntax from IIf to Switch 3
Access Query problem 1
Help with Iif on Report 4

Top