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: 
Not applicable

Linking 2 Tables to form 1 table

 

Hi

 

 

I have 2 tables , a, Transactions table and a Sales Persons table , as shown below. The common field between the 2 tables is the Document number.

 

I am uncertain how to merge the 2 tables so that in my table viewer i want to see 1 table. 

 

 

I have attached

 

  • the QV Model ,
  • The data in  excel
  • a Screen shot of the table viewer.  This is showing the 2 tables linked by the document number.  However I want to achieve only 1 table.



    Please can you help.



    Thank you .

  

 

Transactions Table
DocumentCustomerValue
1A200
2B500
3C300
4D200
5E300

 

Sales Person Table
DocumentSales Person
1Dave
2John
3Mike
4Dave
5Gary
15 Replies
Not applicable
Author

Hi Jonathan

Thank you for the feedback.  I'm using the ApplyMap (the same that Sweuhl suggested)  and see if it works.

Will let you know the outcome.

kind regards

Nayan

Not applicable
Author

Hi Jonathan

The figures are still doubling.  Is it because its the same sales persons in both transactions table, or should this not have an effect?

kind regards

Nayan

jagan
Luminary Alumni
Luminary Alumni

Hi Nayan,

By using ApplyMap() your data will not be doubled the other way is try like this

Transactions:

LOAD *

From Transactions1;


Concatenate(Transactions)  -- Except SalesPerson load all columns

LOAD ...

     DocumentNo

     ...

FROM Transactions2;


SalesPerson:

LOAD DocumentNo, SalesPerson

FROM Salesperson;


Concatenate(SalesPerson)

LOAD DISTINCT

     DocumentNo,

     SalesPerson

FROM Transactions2;


Hope this helps you.


Regards,

jagan.


Not applicable
Author

Hi Jagan

I'll check my links again on the App Map() .  However i will try your  method and let you know.  Thank you for the feedback.

kind regards

Nayan

Not applicable
Author

Hi Jagan

Your scripting works perfectly.  Also the App Mapp scripting worked as well.  Thank you Jonathan & Swuehl for showing me App Mapp and will definitely be using this in the future.

kind regards

Nayan

Not applicable
Author

Hi All

I forgot to mention why the Apply(Map) did not work initially is a silly mistake on my side not having the proper joins in my original scripting.   Otherwise it works perfectly.

kind regards

Nayan