Skip to content

Instantly share code, notes, and snippets.

@luanne
Last active December 10, 2015 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save luanne/4436272 to your computer and use it in GitHub Desktop.
Save luanne/4436272 to your computer and use it in GitHub Desktop.
start t=node:types(id={id})
match
(t)<-[:has_type]-(u)<-[:metric_unit]-(ma)<-[:metric_activity]-(m)<-[cm:cycle_metric]-(c)
where
c.measureDate>={measureStart} and c.measureDate <= {measureEnd}
with distinct m, ma, u, c
match
(ma)-[:metric_unit]->(u)<-[:alert_for_unit]-(a)-[:alert_for_inspection]->(i)-[:has_result]->(ir)
<-[:for_inspection_result]-(a)
where
a.alertDate=c.measureDate
and ((i)<-[:metric_inspection]-(ma))
and a.fromEntityType={type}
return ir.value as alertValue, count(ir.value) as alertCount, u.id as unitId, u.name as unitName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment