I'm not sure if it's a good idea or not, or if there are perhaps better ways of solving this.
When I prepared a blog post, I came across data with this shape:
{
"fy2012": {
"amount": 0.5,
"netOrGross": "Gross"
},
"fy2013": {
"amount": 0.2,
"netOrGross": "Gross"
},
"fy2014": {
"amount": 0.3,
"netOrGross": "Net"
}
}
I'd now like to sum up the amount of all years where netOrGross is Gross.
I don't see a way to do this is a single query currently.
What if I could use a Bind Variable:
find {isGross::(fy2012: {netOrGross: == "Gross"} ||
fy2013: {netOrGross: == "Gross"} ||
fy2014: {netOrGross: == "Gross"})}
return sum(isGross.amount)
I'm not sure if it's a good idea or not, or if there are perhaps better ways of solving this.
When I prepared a blog post, I came across data with this shape:
{ "fy2012": { "amount": 0.5, "netOrGross": "Gross" }, "fy2013": { "amount": 0.2, "netOrGross": "Gross" }, "fy2014": { "amount": 0.3, "netOrGross": "Net" } }I'd now like to sum up the amount of all years where
netOrGrossisGross.I don't see a way to do this is a single query currently.
What if I could use a Bind Variable: