Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
What is ApplyMap()
Have a look at this blog on applymap
http://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap
ApplyMap() is the mapping function :
go to this blog for detailed use and syntaxes
IMP Info Regarding Mapping load
- The mapping table must have only two columns
- The first column is always the ID and second column always the value
- The column names in the mapping table are not relevant
- The mapping table only exists during load
- No associations are made by column name
- Getting the table name right is essential
- No error is raised if you use a mapping table name that doesn’t exist
- It is easy to miss the MAPPING prefix on the load – check this before reload!
** Mapping with Excel File **
** Script Area**
Emp:
Mapping
LOAD emp_id,
name
FROM
(
Detail:
LOAD emp_id,
Salary,
Dept,
ApplyMap('Emp',emp_id) as Emp_name
FROM
(
** Sheet Area**
** Mapping with DATA BASE File **
** Script Area**
Emp:
Mapping
LOAD "DEPARTMENT_ID",
"FIRST_NAME";
SQL SELECT "DEPARTMENT_ID",
"FIRST_NAME"
FROM HR.EMPLOYEES;
LOAD "DEPARTMENT_ID",
"DEPARTMENT_NAME",
"LOCATION_ID",
ApplyMap('Emp',DEPARTMENT_ID) as name;
SQL SELECT "DEPARTMENT_ID",
"DEPARTMENT_NAME",
"LOCATION_ID"
FROM HR.DEPARTMENTS;
** Sheet Area**
** Table Viewer **
** Script Area**
Category:
Mapping
LOAD CategoryId,
// CategoryName,
// SubCategoryId,
CategoryOwner
FROM
(
SubCategory:
LOAD SubCategoryId,
CategoryId,
SubCategpryName,
Quantity,
ApplyMap('Category',CategoryId) as Cat_Owner
FROM
(
** Sheet Area**
** Table Viewer **
** Script Area**
Emp:
Mapping
LOAD * INLINE [
Emp_id, Name
1, Sushil
2, Santosh
3, Sheetal
4, Dhananjay
5, Aditi
];
Detail:
LOAD *,ApplyMap('Emp',Emp_id) as new_name INLINE [
Emp_id, Salary, Dept
1, 5686, HR
2, 4856, PHP
3, 7896, BI
4, 4586, .NET
5, 7586, C++
];
** Sheet Area**
** Table Viewer **
** Script Area**
Orders:
Mapping
LOAD OrderID,
OrderDate
// CustomerID,
//EmployeeID,
//ShipperID,
//Freight
FROM
(
Order_Details:
LOAD OrderID,
LineNo,
ProductID,
Quantity,
UnitPrice,
Discount,
ApplyMap('Orders',OrderID) as Orders
FROM
(
** Sheet Area**
** Table Viewer **
** Script Area**
Category:
LOAD CategoryId,
CategoryName,
SubCategoryId,
CategoryOwner
FROM
(
SubCategory:
inner Keep Category:
LOAD //SubCategoryId,
CategoryId,
SubCategpryName,
Quantity
FROM
(
** Sheet Area**
** Table Viewer **
** Script Area**
Employee:
LOAD EmpName,
EmpNo,
DeptName,
DeptNo,
Office,
Salary
FROM
(
Office:
Inner keep Employee:
LOAD //Office,
EmpName as DeptName ,
OfficeLoc,
Area,
OfficeCategory
FROM
(
Category:
Join Employee :
LOAD OfficeCategory,
CategoryId,
// CategoryCode,
CategoryName
FROM
(
Nested Applymap()
A:
mapping LOAD * INLINE [
emp_id, emp_name
1, niraj
2, sachin
3, Dhananjay
4, Ganesh
5, abhi
6, sachin
];
B:
mapping LOAD * INLINE [
emp_name, loc
niraj, Pune
sachin, Mumbai
swapnil, Delhi
rahul, Banglore
abhi, Delhi
satish, Pune
];
LOAD *,ApplyMap('B',ApplyMap('A',5,'no_data'),'No Data') as New INLINE [
dept_id, dept_name, loc, emp_name
111, IT, Pune, niraj
222, HR, Mumbai, sachin
333, Marketing, Delhi, swapnil
444, Sales, Banglore, rahul
555, Others, Delhi, abhi
666, Health, Pune, satish
];
Hope this will help you to understand what apply map in qlikview
Go to this link
http://www.learnqlickview.com/a-qlikview-tutorial-mapping-load-in-qlikview/
hope this will help you to understand what apply map is
Hi, Narsing Rao.
In addition to Colin's useful link, have a look at Steve Dark's blog on the subject:
http://www.quickintelligence.co.uk/applymap-is-it-so-wrong/
It will show you what you can do with an applymap.
Regards,
Neil
Hi Rao,
ApplyMap is used to mapping any expression to a previously loaded Mapping table
Syntax:
ApplyMap(TableName, FieldName) as FieldName
Hi
Try using help in qlikview desktop, there you will get description with example.
It is generally used to map values of one type to other type like to map country codes with their names.
Cheers
Saurabh