Answered ssrs expression

  • Friday, February 01, 2013 5:54 PM
     
     

    hi

    i want ot do something liek this

    if(previous(fields.gender.value) = fields.gender.value , "",

    iif(fields.gender.value = 1,"m",iif(fields.gender.value = 2 ,"F","U"))

    but this is not working any suggestion

All Replies

  • Friday, February 01, 2013 6:59 PM
     
     

    Try this.

    iif(fields.gender.value = 1,"m")  or iif(fields.gender.value = 2 ,"F","U")

    Also you can use switch method.

    =SWITCH (fields.gender.value = 1 ,"M", fields.gender.value = 2 then "F",fields.gender.value > 2, "U")

    check this link for other method

    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/f1033e5e-999e-4e36-a057-51d113069bb9/


    Please Mark posts as answers or helpful so that others can more easily find the answers they seek.

  • Monday, February 04, 2013 7:38 AM
    Moderator
     
     Answered

    Hi  Tsql,

    Try this expression:
    =IIF(previous(fields!gender.value)=fields.gender.value,"",(iif(fields.gender.value=1,"m",(iif(fields!gender.value=2,"F","U")))))

    Hope this helps.

    Regards,


    Charlie Liao
    TechNet Community Support

  • Monday, February 04, 2013 8:01 AM
     
     
    I assume you're using that Previous function to hide the value when it matches with the previous record?  As an alternative, try grouping the table on the Gender field.

    MCITP SQL Server 2008 (DEV); MCTS SQL Server 2008 (BI, DEV & DBA)
    Check out my articles at BI: Beer Intelligence?