7 Replies Latest reply: Dec 16, 2011 7:20 AM by Roland Kunle RSS

    Adding a field from a table to another table

    Chris Hopkins

      hi,

      I have the following script.

       

      SET cFileName = $(vcRetailQVD)StoreStockMovement*.qvd;
      IF FileTime('$(cFileName)') >= 0 THEN
      StoreStockMovement:
        Join LOAD 
            StoreNumber,
            StoreDate,
            [Stock Movement Reason Code],
             EANCode AS EAN,
            Narrative,
            StockQty,
            StockValue,
            LinesAffected,
            RSPValueDiff,
            CostValueDiff,
            StoreTime,
            %LkStoreReasonCode,
            if(wildmatch(Narrative,'Goods Rec*')>0,'Goods Received/Returned',
            if(wildmatch(Narrative,'Stock*')>0,'Stock Checking Variances')) AS [Stock Reason]     
           
      FROM $(cFileName) (qvd);

      ENDIF

      SET cFileName = $(vcRetailApplicationResource)StoreReasonCode.csv;
      IF FileTime('$(cFileName)') >= 0 THEN
      StoreReasonCode:
           LOAD
           @2 AS [Stock Movement Reason Code],
           @3 AS ReasonDescription,
           @5 AS [Stock Reason],
           @3 & ' - ' & @2 AS [Stock Adj Reason]
          
      FROM [$(vcRetailApplicationResource)StoreReasonCode.csv]
      (txt, codepage is 1252, no labels, delimiter is ',', msq);
      EndIf

       

      I want to add the field created by the IF statements in the first table to the bottom table but i havnt got a clue how to do it.

      If i reload it as it is then i get a syn table and the data from the field 'Stock Reason' in the 2nd table is not available.

       

      Can anyone help please?