7 Replies Latest reply: Aug 31, 2016 10:32 AM by Ankit Chaudhary RSS

    Replace the values

    Ankit Chaudhary

      Capture.JPG

      I wanted to replace the values in my script .The value fields in Severity table were 1,2,3,4 I want to replace the same with High','Medium','Low','very Low'I changed severity in Load as    pick(match(Severity,'1','2','3','4'),'High','Medium','Low','very Low') .The output is as shown above.Can you let me know how can i replace all the values in severity columns with names? or is there any other method?

       

      LOAD id,

        tktid,

        CreateDate,

        Updaterid,

        Name,

        EngagementType,

         pick(match(Severity,'1','2','3','4'),'High','Medium','Low','very Low') ,

          BIZHrMinBetween,

        SLA,

        ticketform,

        Coverage,

        CalMinBetween,

        old_sla;

       

       

      [ticket_status_sla]:

      SELECT id,

        tktid,

        CreateDate,

        Updaterid,

        Name,

        EngagementType,

        ServiceType,

        Severity,

        BIZHrMinBetween,

        SLA,

        ticketform,

        Coverage,

        CalMinBetween,

        `old_sla`

      FROM `ticket_status_sla`;

        • Re: Replace the values
          Gysbert Wassenaar

          [ticket_status_sla]:

          LOAD id,

            tktid,

            CreateDate,

            Updaterid,

            Name,

            EngagementType,

             pick(Severity,'High','Medium','Low','very Low') as Severity,

              BIZHrMinBetween,

            SLA,

            ticketform,

            Coverage,

            CalMinBetween,

            old_sla;

          SELECT id,

            tktid,

            CreateDate,

            Updaterid,

            Name,

            EngagementType,

            ServiceType,

            Severity

            BIZHrMinBetween,

            SLA,

            ticketform,

            Coverage,

            CalMinBetween,

            `old_sla`

          FROM `ticket_status_sla`;

          • Re: Replace the values
            Haikuo Yu

            Please try the following:

               If( Match( [your_value_field] , 1), 'High',   

                    If(Match( [your_value_field], '2'), 'Medium',

                         If(Match( [your_value_field], '3'), 'Low', 'very Low')

                      )

                 ) as your_replace_field ,

              • Re: Replace the values
                Ankit Chaudhary

                Hi Haikuo,

                 

                The code is working fine if I am using different names for "your_value_field" and "your_replace_field".

                 

                If( Match( [Severity] , 1), 'High',  

                        If(Match( [Severity], '2'), 'Medium',

                             If(Match( [Severity], '3'), 'Low',

                             If(Match( [Severity], '4'),'vl')

                          ))

                     ) as SeverityNew,

                 

                This is making  new field.I want to replace the data in the severity table.

                 

                If I am using the SeverityNew as Severity  the code is still showing output as attached in the question above.