Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-04-2021 11:44 PM
Hi all,
I am facing an issue while writing the cypher query for below graph, here I have such paths for different months and many more such paths are there like 01-08-2021, 01-09-2021, 01-10-2021, 01-11-2021 and so on:
I want to write a cypher query that will help me in assigning a property value from 01-08-2021 path node to the next path node which is 01-09-2021.
I tried this if it helps me identify the next path basis the previous path, then I will set the property etc. but this doesn;t work
match p=(v:Production)-[j:transport]->(x:Storage)-[q:transport]->(c:Storage)-[b:transport]->(d:Storage)
with min(v.date) as dt
match p=(v:Production)-[j:transport]->(x:Storage)-[q:transport]->(c:Storage)-[b:transport]->(d:Storage)
where v.date=dt
optional match s=(m:Production)-[n:transport]->(u:Storage)-[o:transport]->(x:Storage)-[z:transport]->(f:Storage)
where m.date=dt+duration('P1M')
return s;
Thanks,
Pragya
Solved! Go to Solution.
10-05-2021 03:24 PM
Check the result for 'dt'
match p1=(v1:Production)-[j:transport]->(x:Storage)-[q:transport]->(c:Storage)-[b:transport]->(d:Storage)
with min(v1.date) as dt
return dt
Post the result .
10-05-2021 12:42 AM
I tried this,
match p1=(v1:Production)-[j:transport]->(x:Storage)-[q:transport]->(c:Storage)-[b:transport]->(d:Storage)
with min(v1.date) as dt
match p2=(v2:Production)-[j:transport]->(x:Storage)-[q:transport]->(c:Storage)-[b:transport]->(d:Storage)
where v2.date=dt+duration('P1M')
set v2.Opening_Inv_Physical=v1.Opening_Inv_Physical
return p2;
10-05-2021 03:24 PM
Check the result for 'dt'
match p1=(v1:Production)-[j:transport]->(x:Storage)-[q:transport]->(c:Storage)-[b:transport]->(d:Storage)
with min(v1.date) as dt
return dt
Post the result .
All the sessions of the conference are now available online