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

Data from Selection of Different Tables

Hi Folks,

I have one Order - Table,

connected with a Customer Table.

Then, I have a Disposer Table

Customer may be a Disposer also, and I want to see the number of orders from both entries,

However, when I select a Disposer, the orders have one/more different Customers (than the disposer).

So I look for a solution to sum Orders by selecting X as a Customer as well as a Disposer.

Any idea?

Thanx in advance,

Wolfgang

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You could try modifying your data model and create a table Relations that contains both the Customers and Disposers and a new table OrderRelation that links this table to the Orders table.

Orders:

LOAD

     OrderID,

     CustomerID,

     DisposerID,

     ...other fields...

FROM

     ...order source table...

     ;

OrderRelation:

LOAD

     OrderID,

     CustomerID as RelationID,

     'Customer' as RelationType

RESIDENT

     Orders

     ;

CONCATENATE (OrderRelation)

LOAD

     OrderID,

     DisposerID as RelationID,

     'Disposer' as RelationType

RESIDENT

     Orders

     ;

Relations:

LOAD

     CustomerID as RelationID

     ....other fields...

FROM

     ...customer and disposer source table...

     ;

.


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

You could try modifying your data model and create a table Relations that contains both the Customers and Disposers and a new table OrderRelation that links this table to the Orders table.

Orders:

LOAD

     OrderID,

     CustomerID,

     DisposerID,

     ...other fields...

FROM

     ...order source table...

     ;

OrderRelation:

LOAD

     OrderID,

     CustomerID as RelationID,

     'Customer' as RelationType

RESIDENT

     Orders

     ;

CONCATENATE (OrderRelation)

LOAD

     OrderID,

     DisposerID as RelationID,

     'Disposer' as RelationType

RESIDENT

     Orders

     ;

Relations:

LOAD

     CustomerID as RelationID

     ....other fields...

FROM

     ...customer and disposer source table...

     ;

.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Thx,

shall investigate this method. Unfortunately Customer and Disposer have the same ID:-(

Wolfgang

Gysbert_Wassenaar

That's what I assumed: a single source table for the customer/disposer data.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi Gysbert, Qlik-Guru, thank you very much!

After some days off (sorry for delay), I figured out that your solution is working
and the answer to my question.

All the best, with many many thanks,

Wolfgang

Anonymous
Not applicable
Author

Thank you,

very good,

this is the answer to my question!

Best regards

Wolfgang