3 Replies Latest reply: Jul 19, 2012 2:35 AM by Jason Michaelides RSS

    How to make expression as Field in the load script

    Siva Boggarapu

      Hi Everyone.

       

      I want to put below expressions into the script as Fileds. But its giving error while putting into the script.

       

      morpheus_market:

       

      load Year,

           [contract name],

           [contract name year],

           [RuleGroup Name],

           Carrier,

           [service class name],

           ClassCode,

           SellupAmount,

           Fare,

           Season ,

           City_from,

           City_to,

           From_region,

           To_region,

           farecomp_class,

           contractname

      FROM

      mopheusdata.qvd

      (qvd);

       

      I want to put below expression into the load script or is there anyway to manipulate the below expressions in simply way?

       

      I want to make below expression as like

       

      1)left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -9 )-1) as Market1

       

      2)

      mid(

      left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -8)-1),

      index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -9 )+1,

      len(left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -8 )-1))

      ) as Market2

       

       

      set vMarket1=left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -9 )-1);

       

      set vMarket2=mid(

      left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -8)-1),

      index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -9 )+1,

      len(left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -8 )-1))

      );

       

      set vMarket3=mid(

      left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -7)-1),

      index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -8 )+1,

      len(left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -7 )-1))

      );

       

      set vMarket4=mid(

      left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -6)-1),

      index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -7 )+1,

      len(left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -6 )-1))

      );

       

      set vMarket5=mid(

      left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -5)-1),

      index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -6 )+1,

      len(left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -5 )-1))

      );

       

      set vMarket6=mid(

      left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -4)-1),

      index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -5 )+1,

      len(left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -4 )-1))

      );

       

       

      set vMarket7=mid(

      left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -3)-1),

      index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -4 )+1,

      len(left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -3 )-1))

      );

       

       

      set vMarket8=mid(

      left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -2)-1),

      index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -3 )+1,

      len(left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -2 )-1))

      );

       

      set vMarket9=mid(

      left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -1)-1),

      index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -2 )+1,

      len(left(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -1 )-1))

      );

       

       

      set vMarket10=mid(GetFieldSelections([morpheus_market.contract name year],'|',10),index( GetFieldSelections([morpheus_market.contract name year],'|',10), '|', -1 )+1,

      len(GetFieldSelections([morpheus_market.contract name year],'|',10)));

       

      Thanks,

      Siva