Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Nested IFERROR or Priority ApplyMap?

Hi Everyone,

I have some data and I would like to add a new column to group them, but through a process of prioritization to generate the new groups.

I have attached an example of how I would do this in Excel, but would like to achieve this in QV.   The new column basically goes through a series of VLookups which I have prioritize by using IFERROR.


I tried to use a mixture of ApplyMaps and nested IF statements in QV, but have no luck in getting all 3 mappings to work seamless.  Ideally, I would like to have the flexibility to have MappingPriority4, MappingPriority5, etc... in the future.

Thank you for your help in advance!

EmployeeData.png

MappingPriority.png

1 Solution

Accepted Solutions
el_aprendiz111
Specialist
Specialist

Hi Jenny

Mapping P1:
LOAD * Inline
[
EID,Grouping
1001,Group A
1002,Group A
1003,Group A
]
;

Mapping P2:
LOAD * Inline
[
Job,Grouping
Director,Group B
Sr Manager,Group C
Manager,Group D
]
;

Mapping P3:
LOAD * Inline
[
Location,Grouping
New Jersey,Group E
New York,Group E
Pennsylvania,Group E
]
;

SUMARY:
LOAD *, ApplyMap('P1',EID,ApplyMap('P2',Job,ApplyMap('P3',Location,'N//A'))) AS MAPPPP;
LOAD * Inline
[
EID,Job,Location
1001,CFO,New York
1002,CEO,New York
1003,COO,New York
1004,Manager,New York
1005,Sr Manager,New York
1006,Director,New York
1007,Staff,Pennsylvania
1008,Staff,New York
1009,Staff,New Jersey
]
;

AMPP.png

View solution in original post

3 Replies
el_aprendiz111
Specialist
Specialist

Hi Jenny

Mapping P1:
LOAD * Inline
[
EID,Grouping
1001,Group A
1002,Group A
1003,Group A
]
;

Mapping P2:
LOAD * Inline
[
Job,Grouping
Director,Group B
Sr Manager,Group C
Manager,Group D
]
;

Mapping P3:
LOAD * Inline
[
Location,Grouping
New Jersey,Group E
New York,Group E
Pennsylvania,Group E
]
;

SUMARY:
LOAD *, ApplyMap('P1',EID,ApplyMap('P2',Job,ApplyMap('P3',Location,'N//A'))) AS MAPPPP;
LOAD * Inline
[
EID,Job,Location
1001,CFO,New York
1002,CEO,New York
1003,COO,New York
1004,Manager,New York
1005,Sr Manager,New York
1006,Director,New York
1007,Staff,Pennsylvania
1008,Staff,New York
1009,Staff,New Jersey
]
;

AMPP.png

Anonymous
Not applicable
Author

Thank you for your fast response!  I didn't know it was possible to nest the ApplyMap function.

el_aprendiz111
Specialist
Specialist