1 Reply Latest reply: Mar 4, 2013 3:56 AM by Gysbert Wassenaar RSS

    How create self-tagging in Qlikview script?

      Hi,

       

      I have this scenario, I have Sales Table that consist of kits and individual SKU, now I want to tagged their parent item, so it may be easier for me to link it to kit maintenance. Below are given tables

       

       

      SOPNUMBERITEMNUMBERLINESEQCOMPONENTSEQ
      SOP0001ITEMA10010
      SOP0001ITEMB10011001
      SOP0001ITEMC10011002
      SOP0001ITEMD10020
      SOP0001ITEME10021002
      SOP0002ITEMB10030
      SOP0002ITEMC10031001
      SOP0003ITEMB10040
      SOP0003ITEMD10050
      SOP0003ITEME10051003

       

      Here are the rules:

       

      1) Sort it by SOPNUMBER

      2) Sort it by LINESEQ

      3) Start tagging using rules below:

           a) If LINESEQ is EQUAL TO ABOVE LINESEQ then, get the previous ITEMNUMBER where COMPONENTSEQ is 0, else just simply get the current ITEMNUMBER; 0 meaning this is the parent item or an individual item;

       

      See results below:

       

      SOPNUMBERITEMNUMBERLINESEQCOMPONENTSEQTAGGED
      SOP0001ITEMA10010ITEMA
      SOP0001ITEMB10011001ITEMA
      SOP0001ITEMC10011002ITEMA
      SOP0001ITEMD10020ITEMD
      SOP0001ITEME10021002ITEMD
      SOP0002ITEMB10030ITEMB
      SOP0002ITEMC10031001ITEMB
      SOP0003ITEMB10040ITEMB
      SOP0003ITEMD10050ITEMD
      SOP0003ITEME10051003ITEMD

       

      What will be the new key to link it to other table is the compound key of: TAGGED + ITEMNUMBER - since I already got the parent item, so this will be unique... My problem now is how to do complex tagging.

       

      Please help me solve this. Thanks.

       

      Regards,

      Bill