# Multivalue error

I have the following issue and need help ASAP…please…

ID Amnt CD

1 100 A
1 100 B
2 200 A
2 200 B

In the report when a variable is use

If CD <> “D” then sum (amnt)

I am getting a multivalue error. I know i am using there are 2 amounts for 2 different CD thats why? how can i fix this multivalue error. PLease help ASAP?
Thanks

BODEV2011 (BOB member since 2010-12-28)

Can you give a try like this.

``=Sum(If CD <> "D" then [amnt] else 0)``

Jansi (BOB member since 2008-05-12)

It wont work plus i dont want to sum the two adjustments i want to bring only 100 for ID 1 and 200 for ID 2.

Thanks

BODEV2011 (BOB member since 2010-12-28)

You have codes for A and B and your formula says <> D. That’s going to bring both.

If you want only B, then try a where clause:

``=Sum([Amt]) Where ([CD] = "B")``

Or the code Jansi provided would work, assuming that you aren’t really looking for everything not equal to D.

Dave Rathbun (BOB member since 2002-06-06)

Thanks but whatever Jansi provided still doesnt work and am getting the multivalue error. I have said it is not equal to “D” coz i want all the amnts other than “D”.

Also i thought if i can use the Where clause instead of If, but i am getting a context error when i use.

=Sum([Amt]) Where ([CD] <> “D”)

BODEV2011 (BOB member since 2010-12-28)

You can’t use <> in a Where clause, it has to be equal. Try this entry in the Deski FAQ, it will show you how to work around that.

Dave Rathbun (BOB member since 2002-06-06)