2 Replies Latest reply: Feb 9, 2016 2:00 AM by Chanty 4u RSS

    measure

    Ravikiran Pat

      Hi All,

       

      Can anyone help me with the conversion of below if loop to case statement. I want to use the below logic in the select statement.

       

      if(MATCH_TYPE = 'VOD','Tier 1', 

        if(MATCH_TYPE <> 'VOD' AND Match(NETWORK_TYPE,'Broadcast', 'Cable') AND Len(Trim(PROGRAM_NAME)) <> 0, 

            if((TIMESHIFT_INDICATOR_ID >= 10 AND TIMESHIFT_INDICATOR_ID <= 16) And SAMPLE <> 0, 

                  'Tier 2','Tier 1'))) 

      As Field_Name

        • Re: Script for a measure
          Gysbert Wassenaar

          Something like this:

           

          LOAD    

               If(MATCH='VOD', 'Tier 1',

                    If(NOT Match(NETWORK_TYPE,'Broadcast','Cable') AND NOT IsNull(program),

                         If(Num#(Left(TIMESHIFT_DESC,2)) >= 8 AND Num(Left(TIMESHIFT_DESC,2)) <=14

                           AND Count(Distinct USERS_META_ID)<>0,'Tier 2','Tier 1')

                    )

               ) as MyField,

               ...other fields...

          FROM

               MyTable

          GROUP BY

               MATCH,

               NETWORK_TYPE,

               program,

               TIMESHIFT_DESC,

               ...other fields....

               ;

          • Re: measure
            Chanty 4u

            ravi,

             

            chk dis link

             

            switch control statement