3 Replies Latest reply: Dec 18, 2012 4:50 AM by sujeet singh RSS

    How I can automatically add an expression when there is a new record added to source table?

      I have two tables one has types(ucode_rp_type) other has values(uadj_amt).

      I want to sum uadj_amt by uadj_code which belongs to certain ucode_rp_type . Each uadj_code should be in one column.

      I could do this by writing an expression for each codekey  :

      Sum ({$<ucode_rp_type={'6'},codekey={'STD-COGS'}>}uadj_amt)

       

      My question is how can I automatically add a column when there is a new codekey added to ucode_rp_type in Q_UCODE table?

       

       

      Q_Uadj:

      Load

        uadj_amt,
       
      uadj_code  as codekey,
        uadj_part  as partkeyuadj,
         upper("uadj_tr_type") as uadj_tr_type;

      SQL SELECT
          "uadj_amt",
          "uadj_code",
           "uadj_part",
          "uadj_tr_type",
      FROM PUB."uadj_det" where "uadj_year"=year(sysdate());

       

       

      for i = 1 to 3

      Q_UCODE:

      Load ucode_ccode as codekey ,
          
      ucode_desc ,
           subfield(ucode_rp_sign,',',$(i)) as ucode_rp_sign,
           subfield(ucode_rp_type,',',$(i)as ucode_rp_type;
      SQL SELECT "ucode_ccode",
          "ucode_desc",
          "ucode_rp_sign",
          "ucode_rp_type"
      FROM PUB."ucode_mstr";
      next

       

      Thanks