3 Replies Latest reply: Oct 25, 2016 3:11 PM by Marco Wedel RSS

    Use value from field in current post

    Johan Bengtsson

      Is there a way to get a value from a field in the current post when reloading? Like Peek(), but from the same post.

       

      The reason is I have to use quite a long formula to get necessary information to an Full Item number field, and I have some more fields that are same data but less characters ([Complete Item No.]: 1111-111-11-11, [Item No.]: 1111-111-11 and more).

       

      Now I use formulas like this:

      LOAD

           left(variant_sku,4)&'-'&

                Num(mid(variant_sku,Index(variant_sku,'-',1)+1,Index(variant_sku,'-',2)-(Index(variant_sku,'-',1)+1)),'000')&'-'&

                mid(variant_sku,Index(variant_sku,'-',3)+1,Index(variant_sku,'-',4)-(Index(variant_sku,'-',3)+1))&'-'&

                Right(variant_sku,2)

                     as [Complete Item No.],

           left(variant_sku,4)&'-'&

                Num(mid(variant_sku,Index(variant_sku,'-',1)+1,Index(variant_sku,'-',2)-(Index(variant_sku,'-',1)+1)),'000')&'-'&

                mid(variant_sku,Index(variant_sku,'-',3)+1,Index(variant_sku,'-',4)-(Index(variant_sku,'-',3)+1))

                     as [Item No.]

      FROM

      [data.csv]

      (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

       

      But I rather like a code looking something like:

      LOAD

           left(variant_sku,4)&'-'&

                Num(mid(variant_sku,Index(variant_sku,'-',1)+1,Index(variant_sku,'-',2)-(Index(variant_sku,'-',1)+1)),'000')&'-'&

                mid(variant_sku,Index(variant_sku,'-',3)+1,Index(variant_sku,'-',4)-(Index(variant_sku,'-',3)+1))&'-'&

                Right(variant_sku,2)

                     as [Complete Item No.],

           left([Complete Item No.],11)

      FROM

      [data.csv]

      (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

       

      I know I can load data and then use "Resident table", but I'm curios if I can get it to work without that?

       

      brg Johan