Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to do mapping two columns into one table but I have an issue with an error like Field names must be unique within the table, please suggest me
here is my script code:
Bonus:
Mapping LOAD * INLINE [
Empcode, Bonus
A001, "1,000"
A002, "1,800"
A003, "4,000"
A004, "21,000"
A005, "10,000"
A006, "28,000"
A007, "1,865"
A008, "5,150"
A009, "10,257"
A010, "28,800"
];
Designation:
Mapping LOAD * INLINE [
Desc_code, Designation_desc
A, Executive
B, Assistant Engineer
C, Sr. Manager
];
Employee:
LOAD * INLINE [
Empcode, Desc_code, Salary, ApplyMap('Bonus',Empcode,0)as Bonus, ApplyMap('Designation',Desc_code,'Unknown')as Designation_desc
A001, A, "16,091"
A002, A, "18,201"
A003, B, "20,000"
A004, D, "22,100"
A005, C, "25,000"
A006, D, "32,000"
A007, A, "45,000"
A008, B, "12,000"
A009, C, "15,000"
A010, D, "16,250"
];
when I am executing above script display an error, please find below error message
Hello,
I don't think Qlik likes to apply a map in an inline load. Try changing the script for your Employee table to the following:
Employee:
LOAD * INLINE [
Empcode, Desc_code, Salary,
A001, A, "16,091"
A002, A, "18,201"
A003, B, "20,000"
A004, D, "22,100"
A005, C, "25,000"
A006, D, "32,000"
A007, A, "45,000"
A008, B, "12,000"
A009, C, "15,000"
A010, D, "16,250"
];
Store Employee into Employee.qvd;
Drop Table Employee;
Employee:
LOAD Empcode,
Desc_code,
Salary,
ApplyMap('Bonus',Empcode,0)as Bonus,
ApplyMap('Designation',Desc_code,'Unknown')as Designation_desc
FROM
Employee.qvd
(qvd);
You should then end up with a table like this: