Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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
];
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
];
Thank you for your fast response! I didn't know it was possible to nest the ApplyMap function.