6 Replies Latest reply on Feb 7, 2013 2:23 PM by Rookie_86

    else condition


      I have a requirement, for the contact_typ='IA' then I need to display last name of the contact.

      I wrote a case statement,

      case when contact_typ='IA' then Last_Name End

      but when executed in report I am getting


      I am also getting other types of contact_types in the end. For IA type it is displaying names, for other types it is null. But I only want contact_typ 'IA' in my report. Since I dint include else in my statement, I am getting that output, but knowing what to include in the else.Please help me.

        • 1. Re: else condition
          Srini VEERAVALLI
          Add a filter on contact_typ='IA' that should avoid other type from report.

          Or else
          case when contact_typ='IA' then Last_Name else 'N' End
          Filter it where <>N

          let me know for issues, if helps mark
          • 2. Re: else condition
            Thank you!!..But I am looking to filter in backend, rather than in filtering in front end, because when business users pull the report they get confused. Any help is highly appreciated
            • 3. Re: else condition
              Srini VEERAVALLI
              In stead of the back end, I would suggest to use logical table source properties content tab->Where clause condition to

              If helps pls mark
              1 person found this helpful
              • 4. Re: else condition
                For the other reports I need to use other contact types, so I cannot use contact_typ='IA' in content tab. Thanks!!!!
                • 5. Re: else condition
                  Srini VEERAVALLI
                  Oh is it! then what is backend? you were telling about it in your last message?

                  Try out as per my 1st suggestion.
                  • 6. Re: else condition
                    Hi SARU,

                    As per my understanding and the forum - you need display last name for the contact typ -= 'IA'
                    And, either you dont want to filter them in logical table source or write a case statement which shows nulls or 'N' and filter by 'N'.

                    And, you mentioned that you need it from back end.
                    So, Why dont you create another column in physical table (Database).

                    Say - I have table employee id, first name, last name, cont type

                    Now modify it by creating another extra column - display name

                    So, your table changes to employee id, first name, last name , cont type, display name

                    Now, based on your condition - update your display name column.

                    If, your unable to do that in database. Create a new physical table in physical layer - using select statement.
                    And, generate the table Emp Display -- which holds Employee id, Display name. And, display name gets generated by case statement.


                    this will definitely resolve your issue.

                    thank you.
                    1 person found this helpful