007programmer
asked on
Already returning distinct values, need counts for each respective value as well
If I run this against a ML database:
let $audiences :=
for $doc in xdmp:directory("/myDirecto ry/")
where fn:contains($doc, 'BLAH')
return $doc/audience
for $audience in distinct-values($audiences )
return $audience
This will return the disctinct values, however I also want the counts for each of these values
let $audiences :=
for $doc in xdmp:directory("/myDirecto
where fn:contains($doc, 'BLAH')
return $doc/audience
for $audience in distinct-values($audiences
return $audience
This will return the disctinct values, however I also want the counts for each of these values
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
The least you can do is respond to my suggestion,
I definitely gave you code to test and debug
So I have to object closing this
The least you can do is respond to my suggestion,
I definitely gave you code to test and debug
So I have to object closing this
My next suggestion would have been to have the distinct-values() on the text nodes that are descendents of the $audience. Some XQuery processors are tricky about that.
But first of course you could have tried the suggestion and could have given feedback about this.
Note that you sollicited for my time, which I voluntarily gave you, the least I can demand is feedback
But first of course you could have tried the suggestion and could have given feedback about this.
Note that you sollicited for my time, which I voluntarily gave you, the least I can demand is feedback
My recommendation:
Accept http:#a37993619
The question was "This will return the disctinct values, however I also want the counts for each of these values "
That is exactly (I tested prior to posting) what the code I posted does
Accept http:#a37993619
The question was "This will return the disctinct values, however I also want the counts for each of these values "
That is exactly (I tested prior to posting) what the code I posted does
ASKER
No suitable answers