3 Replies Latest reply: Oct 22, 2018 10:01 AM by Avinash Chettipalli RSS

    Reducing modifications

    Ali Ait Messaoud

      Hello community, i have a table with contract to which i join brands by their name, this is the script i used:

      Outer Join (contract)

      Load contract_id,

      if(len(contract_id)>1,'brand1') as MARQUE

      FROM [lib://QSData/akusto3.qvd]

      (qvd);

       

      Outer Join(contract)

      Load contract_id,

      if(len(contract_id)>1,'brand2') as MARQUE

      FROM [lib://QSData/ecophon3.qvd]

      (qvd);

       

       

      Outer Join (contract)

      Load contract_id,

      if(len(contract_id)>1,'brand3') as MARQUE

      FROM [lib://QSData/master_matrix3.qvd]

      (qvd);

       

      Outer Join(contract)

      Load contract_id,

      if(len(contract_id)>1,'brand4') as MARQUE

      FROM [lib://QSData/Plafometal3.qvd]

      (qvd);

       

       

      Outer Join (contract)

      Load contract_id,

      if(len(contract_id)>1,'brand5') as MARQUE

      FROM [lib://QSData/rockfon3.qvd]

      (qvd);

       

      Outer Join(contract)

      Load contract_id,

      if(len(contract_id)>1,'brand6') as MARQUE

      FROM [lib://QSData/TEXONA3.qvd]

      (qvd);

       

      My problem is i need to change names of brands and of the files regularly and the number of brands might rise as well as decrease depending on the demand of types of clients.

      How can automate this process, so i could only make a change only once somewhere?

      The table of brands looks like the attached file.

       

      Thanks in advance.

       

      Ali