Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
stanlyrj
Contributor III
Contributor III

Help in mapping the fields

Hi All,

I'm new to QlikView, so I'm still getting my feet wet here I'm trying to modify the Customer field in the "Customer" table as Customer-Branch name

But while using Apply map method it does not map completely

/***********************Mapping Load******************/

MappingLoadCustomerIDtoBranch:

Mapping Load _KEY_Customer,_KEY_Branch

FROM [../1_QVD/Tra/Facts/Customer_Invoices.qvd](qvd);

/*********************** Customer *********************/

Customer_Temp:

LOAD

   _KEY_Customer,

  [Customer ID], 

  Cli_Nombre AS Customer,

  ApplyMap('MappingLoadCustomerIDtoBranch',[Customer ID], null()) as [Branch] ,

[Customer Billing State],

  [Customer Category],

  [Customer Group],

  [Customer Family],

[Customer Status],

[Customer EntryDate]

FROM [..\1_QVD\Ext\Dims\Customer.qvd](qvd);

Community Doubt.JPG

I've tried looking at other postings but I'm not being able to translate them to my reality. Any assistance will be very welcome.


Thanks!

1 Solution

Accepted Solutions
stanlyrj
Contributor III
Contributor III
Author

Thanks for your reply. Since _KEY_Customer and _KEY_Branch are in many to many relationships all the Customer ID are not mapped with _KEY_Branch.

I was able to solve the issue by creating a table by combining two tables Branch and Customer, along with a Customer-Branch composite key.
Cartesian product in QV
I used the above discussion as a reference.

Thank you

Stanly

View solution in original post

5 Replies
vishsaggi
Champion III
Champion III

Did you try this?

LOAD

  _KEY_Customer,

  [Customer ID],

  Cli_Nombre AS Customer,

  ApplyMap('MappingLoadCustomerIDtoBranch', _KEY_Customer , null()) as [Branch] ,

[Customer Billing State],

  [Customer Category],

  [Customer Group],

  [Customer Family],

[Customer Status],

[Customer EntryDate]

FROM [..\1_QVD\Ext\Dims\Customer.qvd](qvd);

stanlyrj
Contributor III
Contributor III
Author

Hi Vishwarath,

I have tried this

ApplyMap('MappingLoadCustomerIDtoBranch', _KEY_Customer , null()) as [Branch] ,

Since _KEY_Customer and _KEY_Branch are in many to many relationships all the Customer ID are not mapped with _KEY_Branch. Could ou please suggest me any alternatives to achieve this result.

Thanks

ger_alegria
Partner - Creator
Partner - Creator

You have to create a Mapping table and after that you can use the Applymap funtion.

hector_munoz
Specialist
Specialist

Hi Stanly,

Try something like this:

/***********************Mapping Load******************/

Mapping1:

Mapping Load _KEY_Branch,

             Branch

FROM         [XXX.qvd](qvd);

MappingLoadCustomerIDtoBranch:

Mapping Load _KEY_Customer,

             ApplyMap('Mapping1', _KEY_Branch, Null())     AS CustomerBranch

FROM         [../1_QVD/Tra/Facts/Customer_Invoices.qvd](qvd);

/*********************** Customer *********************/

Customer_Temp:

LOAD _KEY_Customer,

     [Customer ID],

     Cli_Nombre AS Customer,

     ApplyMap('MappingLoadCustomerIDtoBranch',_KEY_Customer, null()) as [Branch] ,

     [Customer Billing State],

     [Customer Category],

     [Customer Group],

     [Customer Family],

     [Customer Status],

     [Customer EntryDate]

FROM [..\1_QVD\Ext\Dims\Customer.qvd](qvd);

Regards,

H

stanlyrj
Contributor III
Contributor III
Author

Thanks for your reply. Since _KEY_Customer and _KEY_Branch are in many to many relationships all the Customer ID are not mapped with _KEY_Branch.

I was able to solve the issue by creating a table by combining two tables Branch and Customer, along with a Customer-Branch composite key.
Cartesian product in QV
I used the above discussion as a reference.

Thank you

Stanly