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: 
anushka_iconresources
Contributor II
Contributor II

apply map

Hi all,

If we change the name of second parameter in Apply map statement syntax, would it be able to map the data from mapping table?

For eg:

Employees:
mapping LOAD
EmployeeID ,
TerritoryID
FROM [lib://d_qliksense (desktop-gj4iu79_irt)/extract/Territories.QVD]
(qvd);


LOAD
EmployeeID ,
"Extension",
EmployeeName,
Date("Hire Date",'DD/MM/YYYY') AS Hire_Date,
Office,
"Reports To",
Title,
"Year Salary",
ApplyMap('Employees',emp_id) as TerritoryID
FROM [lib://d_qliksense (desktop-gj4iu79_irt)/extract/Employees.QVD]
(qvd)
where not IsNull(EmployeeID) ;

 When i am using emp_id, it is throwing error.  

 

Labels (3)
3 Replies
Or
MVP
MVP

Not quite sure what you're asking here, but... there's doesn't seem to be an emp_id field in your data? There's no problem with using whatever field - you can map using Title and it'll "work" (but presumably return no value) - but it has to be a valid field from the table being loaded.

anat
Master
Master

ApplyMap('Employees',EmployeeID) as TerritoryID

MatheusC
Specialist
Specialist

Hi, @anushka_iconresources 

I also don't know if I understand this name change.

But if in this case your table has an as emp_id, like this ex:

load
EmployeeID as emp_id,
ApplyMap('Employees',EmployeeID) as TerritoryID,
...
(qvd);

it will actually bring an error, because when you are doing the applymap this field is still as EmployeeID, that is, you need to use the original field as mentioned by @anat .



Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!