3 Replies Latest reply: Feb 5, 2017 11:18 AM by Rahul Pawar RSS

    Mapping table with several confitions if the result isnt available in the original table

    pedro juarez

      Hi

       

      I have been working with several tables in qlikview however i want to pull some information from one table where i could find the information, however in the case it isnt I want to generate the information using several conditionals using the information that I have in the table where i want to aggregate the information

       

      my script look like this, however it doesnt do what i have to change to make it work

      BASE:

      LOAD CODIGO,

           ORIGEN

      FROM

      [C:\Users\Pedro_Juarez\Documents\PMJT\BASE´S Y OTRAS EXTRACCIONES\BASE MX 020117.xlsx]

      (ooxml, embedded labels, header is 3 lines, table is H_5857);

       

       

      TEMP_REGALIAS:

      MAPPING LOAD CODIGO,

           [% REG]/100 as REG

      FROM

      [C:\Users\Pedro_Juarez\Documents\PMJT\BASE´S Y OTRAS EXTRACCIONES\Regalias.xlsx]

      (ooxml, embedded labels, header is 2 lines, table is [% Regalia]);

       

       

      TEMP_PREFIJO:

      MAPPING LOAD CODIGO,

              LEFT(CODIGO,3) AS PREFIJO

      FROM

      [C:\Users\Pedro_Juarez\Documents\PMJT\BASE´S Y OTRAS EXTRACCIONES\BASE MX 020117.xlsx]

      (ooxml, embedded labels, header is 3 lines, table is H_5857);

       

       

      Royalty:

      LOAD

            ApplyMap('REG',CODIGO,

            IF(NOT MATCH(PREFIJO,'844') and Match([ORIGEN], '2','3','6'),.1,

            IF(MATCH(PREFIJO,'844'),.2,

            IF(Match([ORIGEN], '1'),0,.15)))) as REGALIA

       

      thanks for your help

      regards