August 5, 2010 at 3:59 pm
I have a report that has dynamic groups. On the DataTable itself I have a filter like this:
================================
(left side):
iif(Parameters!dsSalesStatus_QUERYNUM.Value="4",Parameters!SelectedItemList.Value(0),parseItemId(Fields!ItemId.Value,Parameters!AX_CompanyName.Value))
Operator: In
(right side):
Parameters!SelectedItemList.Value
==================================
whenever the QUERYNUM value is not 4 this works fine. I have used an iif statement in the filter expression many many times but this one just doesn't work.
Both options of the Iif statement work individually if I remove the iif() and hard code it to the value that should be selected.
Any suggestions?
Thanks,
Don Shields
August 6, 2010 at 2:31 am
Can you try enclosing the first statement in iif within the braces()
IIF((condition),true,false)
August 6, 2010 at 9:30 am
What is the datatype of the parameter used in the IIF? If it's an integer, you shouldn't have the "4" quoted right?
Steve.
August 6, 2010 at 9:40 am
It's a string but I have tried it both in and out of quotes as well as CStr(4). Same results.
thx
August 6, 2010 at 9:59 am
no difference.
August 6, 2010 at 10:17 am
The param "SelectedItemList" is definitely a multivalue parm?
Steve.
August 6, 2010 at 11:07 am
After further testing it looks like what is happening is that the iif() evaluates the formula in the False portion of the function even if that is not what the logic is going to select. In the case where the test value ="4" the field Fields!ItemId.Value doesn't have anything in it, which seems to be causing a problem.
Don
August 6, 2010 at 11:15 am
Finally figured it out. Had to rewrite the datamethod parseItemId() to work even if the parameter that was passed to it is blank or nothing. Even though the logic will not select a value in an if statement it appears that the value must still be valid.
Don
August 6, 2010 at 11:21 am
Sorry, missed your 'solved it' post. Glad you got it working. That IIF evaluation isn't nice.
Steve.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply