How to make a table report by grouped aggregation count?

Hi all.

This seems similar as How to make histogram by grouped aggregation count? to me that is nicely answered by @timroes.
I have a data that I think has the same structure, although no integers here:

{ "action": "play", "user": "john", "content": "cnn" }
{ "action": "play", "user": "maria", "content": "cnn" }
{ "action": "play", "user": "john", "content": "bbc" }
{ "action": "play", "user": "maria", "content": "bbc" }
{ "action": "play", "user": "john", "content": "cnn" }
{ "action": "play", "user": "john", "content": "cnn" }
{ "action": "play", "user": "john", "content": "vh1" }

On that I create a table report to show me how many times the content is played using terms and split row

And this works nicely. For above data set this would give me:

cnn 4
bbc 2
vh1 1

But I also need another report to show the count of users that played this content. Since one user can play one content multiple times, I just want to see how many users have done the play action on content.
For above data set this would the look like:

cnn 2
bbc 2
vh1 1

I actually need just the report so I choose data table which I can export to csv. I tried to do some sibling aggregations but I always end up without grouping. Can this be done in some other way?

Thanks

Hi Petar,

that is actually way easier then the the referenced question :slight_smile:

Just change the Metrics aggregation from Count to Unique count on the user field. That will now group by watched channel, but instead of showing the actual play documents, just count how many individual users existed that watched that channel, and will result in the required graph.

Cheers,
Tim

Oh, wow. I did try something with unique count but I must have made some other changes and confused myself :slight_smile:

Thanks @timroes, sorry for bothering

Absolutely no issue, that's what we are here for :slight_smile:

Always feel free to come back with further questions.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.