Hello there,
I'm struggling to make a clean query that gets all the nodes with labels and its connections (relations) and built a concise table in PowerBI.
I have the following hierarchy scheme into the Neo4j:
All I want is to bring this to PowerBI, and the big issue is that the last level of the hierarchy (Activity) is connected to 4 different kind of nodes at the same level (Constraint - gray / AdittionalInformation - green / Program - dark yellow / Commitment - light yellow, and 1 node before (Permition - blue).
When I make the following query on the Neo4j Browser it looks perfect! But, the table once opened into PowerBI comes with triplicated rows, with repeated activities.
MATCH (c:Company)-[w]->(o:OperationalUnit)-[z]->(p:Project)-[x]->(l:Permition)-[:HAS_ACTIVITY]->(n)
WHERE p.deleted_at IS NULL
AND p.migration_id IS NULL
AND l.deleted_at IS NULL
AND l.migration_id IS NULL
AND n.deleted_at IS NULL
AND n.migration_id IS NULL
OPTIONAL MATCH (l)-[s]-(m)-[:HAS_ACTIVITY]-(a:Activity)
WHERE m.deleted_at IS NULL
AND m.migration_id IS NULL
AND a.deleted_at IS NULL
AND a.migration_id IS NULL
AND l.deleted_at IS NULL
AND l.migration_id IS NULL
RETURN DISTINCT c,o,p,l,n,m,a
Anyone with a fresh mind to help me create a clean query and get all the data and it´s relations, or in another words, a table with all the activities (brown circles) and all the path that they are related?
I´m a complete newbie to Neo4j, and I'm not a IT professional... so please understand if this is a silly issue ;)
Thank you, Leo