3 Replies Latest reply: Mar 21, 2018 9:31 AM by Sunny Talwar RSS

    Required expression

    Ravi Kumar

      Hi Community,

       

      I have an requirement:

      1. I have fields OPU, Draft 1, Draft 2, Draft 3.
      2. based on this 4 fields , want do describe 5 th field "Required Result".
      3. comparing to OPU , NULL Draft number requiredd to display.
      4. I want to require a expression .
      5. when two fields null then those both fields required to display

       

          

      OPUDraft 1Draft 2Draft 3Required Result
      ABC14 01 201505 01 201520 06 2015Null
      PPTSB10 03 2017-15 04 2017Draft2
      VPSB20 04 201725 05 2017-Draft3
      PLMMSB17 07 2017-25 08 2017Draft2
      PMTSB-10 04 201702 04 2017Draft1
      VSKP--04 02 2018Draft 1 & Draft 2

       

      Thanks,

      Ravi.

        • Re: Required expression
          Sunny Talwar

          Only one of the Drafts can ever be null? If that is true, then may be this

           

          If(Len(Trim([Draft 1])) = 0, 'Draft1',

               If(Len(Trim([Draft 2])) = 0, 'Draft2',

                    If(Len(Trim([Draft 3])) = 0, 'Draft3', 'Null'))) as [Required Result]

          • Re: Required expression
            Ravi Kumar

            Hi Sunny,

             

            when Draft 1 , Draft 2 both null means required Result: Draft 1 & Draft 2

             

            Thanks,

            Ravi.

              • Re: Required expression
                Sunny Talwar

                May be this

                 

                If(Len(Trim([Draft 1])) = 0,

                     If(Len(Trim([Draft 2])) = 0,

                          If(Len(Trim([Draft 3])) = 0, 'Draft1 & Draft2 & Draft3', 'Draft1 & Draft2'),

                     If(Len(Trim([Draft 3])) = 0, 'Draft1 & Draft3', 'Draft1'),

                     If(Len(Trim([Draft 2])) = 0,

                          If(Len(Trim([Draft 3])) = 0, 'Draft2 & Draft3', 'Draft2'),

                          If(Len(Trim([Draft 3])) = 0, 'Draft3', 'Null'))) as [Required Result]