2 Replies Latest reply on Sep 13, 2017 5:15 PM by Marc Schweid

    RPL Help using Rapid Retargeter Table (RRT) - String Function

    Marc Schweid

      I am trying to get to the last item of the string from a data table then set it as a temporary value

      Data Table:

      !MasterData / RRT_BROWSE_ABANDON_EVENT_PET

      Data Column:

      BA_AGGPARA01

       

      The strings are of various lengths and the item numbers vary in length between 4-6 numbers.

      If there is more than one product number it is always separated by a comma.

       

      Sample file data sets:

      28070,141556

      140674,141564,90904

      126081,134815,134886,144063,143604,146536

      27542

      140662

      27523,27569,117449,20694,118956,134828,37067,71968,36111,24993

       

      Expected values from the above sets are:

      141556

      90904

      146536

      27542

      140662

      24993

       

      We have tried various RPL methods with no luck.

      Please HELP!

       

      Thank you

        • 1. Re: RPL Help using Rapid Retargeter Table (RRT) - String Function
          Ernest Salazar-Oracle

          Hi Marc,

           

          So if I understand this correctly, the data set looks like this: BA_AGGPARA01          27523,27569,117449,20694,118956,134828,37067,71968,36111,24993

           

          The way i would split this is with #list.

           

          Example:

           

          This is a split list test to only select the last item in the list.

                  <#list BA_AGGPARA01?split(",") as BA_ITEM>

                     ${BA_ITEM} <#assign item_last =  BA_ITEM> <br/>

                  </#list>

          LAST ITEM:       ${item_last}

           

          Running this will show you  the list, and should show you the last item.

           

          Test it out and see if this does what  you expect.

           

          WHAT THE CODE IS DOING:  It's simply overwriting the variable item_last every time the list pulls a new record with the new record.  The end result should be the last record that was pulled.  Its up to you if you want to use #assign or #global.

           

          Let me know if this isn't working.

          1 person found this helpful
          • 2. Re: RPL Help using Rapid Retargeter Table (RRT) - String Function
            Marc Schweid

            This solved the problem - THANK YOU