Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

MAPPING requires 2-column input!!!!

Hi All ,

          Am Creating ht ApplyMap between 2 Tables when i reload the table am getting error like MAPPING requires 2-column input!   can give me the solution whats wrong in that  ?


plaese find below script;


Thanks in advance


GIS_DEPARTMENT_MSTR:

Mapping

LOAD

     DEPARTMENT_CODE  ,

     DEPARTMENT_NAME,

      D_LOB,

     CLIENT_NAME as CLIENT_NAME,

     INT_VERTICAL_CODE  as INT_VERTICAL_CODE

FROM

$(vQVPath)Master Files\D_GIS_DEPARTMENT_MSTR.xlsx

(ooxml, embedded labels, table is Sheet1);

GIS_REQUISITION:

LOAD

     REQ_NO,

     REQ_NO as REQ_NO_Req,

     REQ_DATE,

     REQ_DATE as TempDate_Req,

     Date(Timestamp(REQ_DATE),'DDMMYYYY') as %KeyReqDate,

     APPROVED_DATE,

     HR_AGREED_DATE,

//   GRADE_CODE,

     DP_CODE as DEPARTMENT_CODE ,

    ApplyMap("GIS_DEPARTMENT_MSTR","CLIENT_NAME", "Unknown") as REQ_Client_Name,

//   SP_CODE, 

     BUILDING_CODE,

     NUM_OF_PEOPLE_REQD,

     D_REQ_STATUS,

     If(Isnull(D_REQ_STATUS), 1,0) as OpenFlag,

     If(Isnull(D_REQ_STATUS), 'Open','Closed') as OpenDesc,

     D_RECRUITER_ID,

     D_REQ_CLOSED_DATE

FROM

$(vQVPath)DATA Files\D_GIS_REQUISITION.xlsx

(ooxml, embedded labels, table is Sheet1);

1 Solution

Accepted Solutions
Not applicable
Author

Mapping table can have only two fields. Try this

GIS_DEPARTMENT_MSTR:

Mapping

LOAD

     DEPARTMENT_CODE  ,

     CLIENT_NAME

FROM

$(vQVPath)Master Files\D_GIS_DEPARTMENT_MSTR.xlsx

(ooxml, embedded labels, table is Sheet1);

But keep in mind that if there are multiple Client Names for One department code, it will just pick the first name.

View solution in original post

2 Replies
JonnyPoole
Employee
Employee

The error is accurate because the table with your mapping load has 5 columns and not 2 columns. 1 of the columns is the find column, the other is the replace. 

-------

The mapping prefix is used to create a mapping table that can be used for e.g. replacing field values and field names during the script run.

It can be put in front of a Load or Select (SQL) statement and will store the result of the loading statement as a mapping table. A mapping table consists of two columns, the first containing comparison values and the second containing the desired mapping values. Mapping tables are stored temporarily in the memory and dropped automatically after the script execution. 

Not applicable
Author

Mapping table can have only two fields. Try this

GIS_DEPARTMENT_MSTR:

Mapping

LOAD

     DEPARTMENT_CODE  ,

     CLIENT_NAME

FROM

$(vQVPath)Master Files\D_GIS_DEPARTMENT_MSTR.xlsx

(ooxml, embedded labels, table is Sheet1);

But keep in mind that if there are multiple Client Names for One department code, it will just pick the first name.