Hi Community,
I am struggling to reproduce a classic SQL join pattern in Celonis PQL and would appreciate some guidance.
### Data Model
I have an **N:1:M relationship** between three tables:
- **Table A** – Material (1 record per material)
- **Table B** – SalesOrg-related attributes
- N records per material
- Foreign key: `B.material_id → A.id`
- **Table C** – Plant-related attributes
- M records per material
- Foreign key: `C.material_id → A.id`
### What I want to achieve
For each material, I want to display **all possible combinations** of SalesOrg and Plant, i.e. the cartesian product of tables B and C per material.
### SQL reference (works as expected)
In SQL I would do something like:
SELECT A.id, B.org, C.plant
FROM A
LEFT JOIN B ON A.id = B.material_id
LEFT JOIN C ON A.id = C.material_id
Problem in Celonis / PQL
I simply do not manage to reproduce this in a View via PQL. In particular, I fail to get three columns in a table view (material, org, plant) showing all combinations of B and C for each A.
Any hints or best practices would be highly appreciated.
Thanks in advance!