Nested IIF not working

2 posts, 1 answers
  1. Pinkesh
    Pinkesh avatar
    28 posts
    Member since:
    Sep 2015

    Posted 28 Nov 2016 Link to this post

    Im trying to use nested if statement, but it fails to work:

     

    inside my textbox:

    =Max(IIF(Fields.RequestContactCodeDescription = "Broker", 
    IIF(Fields.HomePhoneNo = "", IIF(Fields.BusinessPhoneNo = "", IIF(Fields.CellNo = "", "No Contact Num", Fields.CellNo), Fields.BusinessPhoneNo), Fields.HomePhoneNo), ""))

     

     

    equivalent pseudo if statement:

    If(Fields.RequestContactCodeDescription == "Broker"){

         if(Fields.HomePhoneNo == ""){

              if(Fields.CellNo == ""){

               [...]

              }else{

                //Show CellNo

              }

          }else{

             //Show HomePhoneNo

         } 

    }else{

    //show nothing

    }

     

    What I want it to do:

    Find the entries that has 'Broker' as the code Description. Then show his Home phone number, if he doesnt have that then show his Cell number, if he doesnt have that then show his Business number

  2. Answer
    Stef
    Admin
    Stef avatar
    3610 posts

    Posted 29 Nov 2016 Link to this post

    Hello Pinkesh,

    The expression works correctly in our test, please check the attached TRDP file in the Standalone Report Designer of Telerik Reporting R3 2016 or newer.

    Double-check if the fields are of string type and if they come as empty strings (""), null or other that mey require comparing them to different values e.g. as condition Fields.CellNo Like '' or Fields.CellNo Is Null or IsNull(Fields.CellNo,'') Like ''.


    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top