Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Scripting Help

Hi

I have 2 tables.  The first has 3 fields:

Date, Supplier, Sales

the second has 3 fields

Date, Customer, Sales

Therefore I know the sales by customer by date and I know the sales by supplier by date and for any day the sum of sales are the same in both tables.  I want to create a table that shows the sales by customer AND supplier.  How can I do this?

Thanks

3 Replies
Anonymous
Not applicable
Author

you an combine the two tables

Supplier:

noconcatenate load

Date,

Supplier,

Sales as Supplier.Sales

from ..

Customer:

noconcatenate load

Date,

Customer,

Sales as Customer.Sales

from ..

outer join(Supplier)

load *

resident Customer;

drop table Customer;

rename table Supplier to FactTable;

sunny_talwar

If I am thinking about this correctly, you might need another key field (May be OrderID) to  order to know which supplier sold to which customer. Right now the way your two tables are structured seem to join the two tables on Date and Sales Amount. If for some reasons there are two Suppliers or Two Customers who did same amount of sales on the same day you will end up having a Cartesian product between the two tables. So I think having a OrderID will def. help here.

Colin-Albert

You can concatenate the two tables to create a single table with 4 columns: Date, Supplier, Customer, Sales

Sales:

load

     Date,

     Supplier,

     Sales

from ..

concatenate(Sales)

load

     Date,

     Customer,

     Sales

from ..