Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 IIF statement

Author  Topic 

gavakie
Posting Yak Master

221 Posts

Posted - 2008-05-08 : 16:00:58
I keep getting a too many arguments error any ideas.


=IIF(Parameters!VersionSelection.Value = "Negatives",
IIF(Fields!QuantityOnHand.Value < 0, 1,0),

IIF(Parameters!VersionSelection.Value = "Overages",
IIF((Fields!QuantityOnHand.Value + Fields!QuantityOnOrder.Value) > Fields!RestockLevel.Value+Fields!MOQ.Value, 1, 0),

IIF(Parameters!VersionSelection.Value = "Shortages",
IIF((Fields!OnHandOnOrderDOS.Value - (Fields!MinimumShelfQuantity.Value/Fields!AdjustedSalesPerDay.Value))
< (Fields!LeadTime.Value+Fields!TransitTime.Value)
OR Fields!OnHandOnOrderDOS.Value < Fields!SafetyStock.Value, 1, 0),

I keep getting a to many arguments in my parameter in Ideas would be great.

IIF(Parameters!VersionSelection.Value = "Stock Outs",
IIF(Fields!OnHandOnOrderDOS.Value < (Fields!LeadTime.Value+Fields!TransitTime.Value), 1, 0),

IIF(Parameters!VersionSelection.Value = "Need to Order",
IIF((Fields!QuantityOnHand.Value + Fields!QuantityOnOrder.Value) < Fields!ReOrderPoint.Value, 1, 0),

IIF(Parameters!VersionSelection.Value = "Order Review",
IIF((Fields!QuantityOnHand.Value + Fields!QuantityOnOrder.Value) < Fields!ReOrderPoint.Value, 1, 0)
And Fields!Reason.Value = "Meet Minimum Design Quantity",1,0),
1))))))

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-08 : 16:26:00
Yikes!

In words, what are you trying to accomplish?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

nheidorn
Starting Member

28 Posts

Posted - 2008-05-08 : 16:56:04
I can't guarantee it's the only problem, but it looks like you have one too many closing parenthesis.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-09 : 10:23:33
quote:
Originally posted by gavakie

I keep getting a too many arguments error any ideas.


=IIF(Parameters!VersionSelection.Value = "Negatives",
IIF(Fields!QuantityOnHand.Value < 0, 1,0),

IIF(Parameters!VersionSelection.Value = "Overages",
IIF((Fields!QuantityOnHand.Value + Fields!QuantityOnOrder.Value) > Fields!RestockLevel.Value+Fields!MOQ.Value, 1, 0),

IIF(Parameters!VersionSelection.Value = "Shortages",
IIF((Fields!OnHandOnOrderDOS.Value - (Fields!MinimumShelfQuantity.Value/Fields!AdjustedSalesPerDay.Value))
< (Fields!LeadTime.Value+Fields!TransitTime.Value)
OR Fields!OnHandOnOrderDOS.Value < Fields!SafetyStock.Value, 1, 0),

I keep getting a to many arguments in my parameter in Ideas would be great.

IIF(Parameters!VersionSelection.Value = "Stock Outs",
IIF(Fields!OnHandOnOrderDOS.Value < (Fields!LeadTime.Value+Fields!TransitTime.Value), 1, 0),

IIF(Parameters!VersionSelection.Value = "Need to Order",
IIF((Fields!QuantityOnHand.Value + Fields!QuantityOnOrder.Value) < Fields!ReOrderPoint.Value, 1, 0),

IIF(Parameters!VersionSelection.Value = "Order Review",
IIF((Fields!QuantityOnHand.Value + Fields!QuantityOnOrder.Value) < Fields!ReOrderPoint.Value, 1, 0)
And Fields!Reason.Value = "Meet Minimum Design Quantity",1,0),
1))))))


Your expression seems really confusing. Can you specify what you are trying to achieve?
Go to Top of Page
   

- Advertisement -