2 Replies Latest reply: Feb 22, 2012 2:52 AM by Jean-Paul Camelbeek RSS

    Load Script - Using Variables

      Hi All

      Is there a way of using variables and interacting with the fields inside a load script without each statement having to load a value.


      The script needs to analyse a field [coverage area] that is already resident from a previous load statement and based on finding a substring ':' decide how to load it.


      I have 2 examples below.


      The first example doesn't work but is more logical to me


      set vPosition = 1;

      set vSubString = 'substring';


      load [ID] as [ID],

      $(vposition) = index([coverage area], ':', 1),

      if($(vposition)<>1,left([coverage area], $(vposition))) as [Coverage Group],

      resident timeentries;


      The second example works, but I find there is a limit to the amount of nested logic that can be contained within one statement



      load [ID] as [ID],

      if(index([coverage area], ':', 1)<>0,left([coverage area],index([coverage area], ':', 1))) as [Coverage Group]

      resident timeentries;


      Any pointers would be much appreciated.