Iif statement help

  • I can't get the following to work:

    =IIf(First(Fields!PositionType.Value, "devCECS")="3",false,true)

    I want to show or hide depending on this text within the specificed field. The field may contain other values separated by commas, i.e, 1,3,4,

    Can I use wildcard before and after? If so, what is the correct syntax?

    Thanks for your help.

    SSRS 2005

  • Not 100% on this, but try LIKE '%3%' rather than ='3'.

    Good luck.

  • Sorry for the double post, just saw in another email that the wildcard for SSRS is * not %.

  • Thank you. Like "*3*" did work.

  • With the suggested '*3*' pattern match be careful your possible list of values does not extend into the teens and beyond, a value of 13 (23, A3BC, etc .) in the list would also return true in addition to the value of 3. In this case to be more specific to get just the value of 3 you might need to include a set of multiple conditions to include the delimiter like '*,3,*' but even this is not foolproof. Most accurate option is to write a generic regexp-like code routine in the report where you pass in the delimited string, the value you want to match, and possibly the delimiter so that the routine is truly reusable. The code routine parses thru the delimited list entry by entry thus getting individual values for each entry you can match exactly against.


    maddog

  • Thanks.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply