Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis - given a subset of users, count users

I'm looking to write a set analysis that counts a number of users from a subset of users.

Here's the data I'm working with:

MaxScroll only populates if HitType is 'Scroll'

UserIdPageHitTypeMaxScroll

1

www.blah.com/blah1Scroll0
2www.blah.comScroll0.25
2www.blah.comClick-
3www.blah.com/blah2Scroll0.50
4www.blah.com/blahScroll0.75
4www.blah.com/blahClick-
5www.blah.com/blah3Scroll0.25

I need to count UserId's of users who scrolled more than 0, and who also clicked.

count({<HitType = {Scroll, Click}, MaxScroll -= {0}>}distinct UserId) does not work, since MaxScroll is null in cases of 'Click' HitType, so it returns 0.

Basically I need users who scrolled over 0 (easy =count({<HitType = {Scrolling}, MaxScroll -= {0}>}distinct UserId)) and of those users how many clicked. I'm not sure how to go about doing this.

Thanks in advance.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like

=Count({<UserId = p({<HitType = {Scrolling}, MaxScroll -= {0}>})*p({<HitType = {Click}>}) >} DISTINCT UserId)

View solution in original post

3 Replies
swuehl
MVP
MVP

Maybe like

=Count({<UserId = p({<HitType = {Scrolling}, MaxScroll -= {0}>})*p({<HitType = {Click}>}) >} DISTINCT UserId)

Not applicable
Author

That worked, thanks!

Would you mind explaining why that worked? I've read about the p() function, but I'm not sure how it's working in this case.

swuehl
MVP
MVP

You probably know the white / green / grey colors in QV list boxes.

The p() functions work like retrieving the white colored UserID when you make selections HitType = {Scrolling}, MaxScroll -= {0} resp. HitType = {Click}. So you are retrieving two sets for UserID, then intersect these two sets using the intersection operator *.

Basically it's just translating your requirement

"Basically I need users who scrolled over 0 (easy =count({<HitType = {Scrolling}, MaxScroll -= {0}>}distinct UserId)) and of those users how many clicked. I'm not sure how to go about doing this."

into QV syntax: