5 Replies Latest reply: Jun 29, 2016 6:53 AM by Sunny Talwar RSS

    Month Over Month Comparison of string Fields

    Deepak Sharma



      I have a requirement to compare string fields over the months for any change in the string value.


      For Example :


      I have to compare the status of countries and have to color the background if there ia any change in status.

      For india status is "Hign" in May and changed to "Low" in June so I have highlight the change.


      Month              Country               Status


      May                 India                    High

      June                India                    Low

      July                 India                    Low

      May                 Japan                  Low

      June               Japan                   Low

      July                Japan                   Low


      Can some one help me out . This is urgent!!

        • Re: Month Over Month Comparison of string Fields
          Sunny Talwar

          Like this?




          Used the following script to create a flag:



          LOAD Month(Date#(Month, 'MMMM')) as Month,



          LOAD * INLINE [

              Month,              Country,              Status

              May,                India,                    High

              June,                India,                    Low

              July,                India,                    Low

              May,                Japan,                  Low

              June,              Japan,                  Low

              July,                Japan,                  Low




          LOAD *,

            If(Country = Previous(Country) and Status <> Previous(Status), 1, 0) as Flag

          Resident Table

          Order By Country, Month;


          DROP Table Table;


          and then used the following background expression:

          =If(Flag = 1, LightRed())