Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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...
;
.
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...
;
.
Thx,
shall investigate this method. Unfortunately Customer and Disposer have the same ID:-(
Wolfgang
That's what I assumed: a single source table for the customer/disposer data.
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
Thank you,
very good,
this is the answer to my question!
Best regards
Wolfgang