Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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.
ApplyMap('Employees',EmployeeID) as TerritoryID
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 .