I agree with Eve

Return size(collect(distinct color))) as colors, size(collect(distinct size))) 
as sizes


Von meinem iPhone gesendet

> Am 20.04.2016 um 00:33 schrieb Eve Freeman <[email protected]>:
> 
> Can you give an example output?
> 
> There are two ways I typically do this:
> - collect the field I don't want to aggregate along with the count, then 
> later unwind and count it while collecting the first field.
> - Collect both fields, then write a collection function aggregation with 
> reduce or something.
> 
> Eve 
> 
>> On Tuesday, April 19, 2016, Benoit Simard <[email protected]> wrote:
>> Hi,
>> 
>> You can't make two distinct aggregation on one query, so you have to make 2 
>> queries.
>> 
>> But you can join your queries result with UNION.
>> 
>> Cheers
>> 
>> Le 19/04/2016 22:45, Clark Richey a écrit :
>>> hi! I’m running neo 2.3 and I have a node, call it a Shoe with (for 
>>> example) two properties, color and size. I have a cypher query that finds 
>>> the shoes people bought on a given day. What I want to know is the count of 
>>> shoes with distinct sizes and the count of shoes with distinct colors. I 
>>> can easily get that information via 2 separate queries. I can         also 
>>> get the count of distinct combinations of size / color pairings but that 
>>> isn’t what I want. 
>>> 
>>> Is there a way to get the counts of shoes with distinct sizes and the count 
>>> of shoes with distinct colors in a single query?
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Neo4j" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Neo4j" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to