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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mapping or ???

I have two files as shown below

Customer Master File

CustID  Sales Person

123      U10

Budget File

CustID  Sales Person

123      U12

123R    U12

The Customer Master file shows U10 as the customer was reasigned to a different Sales Person.

I need the budget file to show U10 for both Customer IDs 123 and 123R.  Note: CustomerID 123R is not in the customer master file. It is a "fake" customer in the budget file that holds a rebate budget , hence the "R" after the real customer ID.

How would I accomplish this?

Thanks,

Stephen

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Stephen,

Mapping is fine, for example:

Map:
MAPPING LOAD DISTINCT
CustID as Input
"Sales Person" as Output
RESIDENT "Customer Master File";

Data:
LOAD
CustID,
applymap('Map', purgechar(CustID, 'R')) as "Sales Person"
RESIDENT "Budget File";

Regards,
Michael

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Stephen,

Mapping is fine, for example:

Map:
MAPPING LOAD DISTINCT
CustID as Input
"Sales Person" as Output
RESIDENT "Customer Master File";

Data:
LOAD
CustID,
applymap('Map', purgechar(CustID, 'R')) as "Sales Person"
RESIDENT "Budget File";

Regards,
Michael

Not applicable
Author

Yes, thanks Michael. I forgot that the applymap needed to be a "RESIDENT" table load.

Stephen

eddysanchez
Partner - Creator
Partner - Creator

[Customer Master File]:

LOAD * Inline [

CustID,  Sales Person

123,      U10

];

//[Budget File]:

Left Join ([Customer Master File])

LOAD CustID, [Sales Person] as [Sales Person Budget] Inline [

CustID,  Sales Person

123,      U12

123R,    U12

];

DROP Field CustID;

//[Budget File]:

Left Join ([Customer Master File])

LOAD CustID, [Sales Person] as [Sales Person Budget] Inline [

CustID,  Sales Person

123,      U12

123R,    U12

];