Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count distinct in Set Analysis


Hiya,

I'm trying to count a total number of users and a total number of users accessing. I'm using data from Google analytics.

I'd like this to be a KPI so I created two text objects:

Total number of users: Sum(DISTINCT(User))

Total number of users accessing:  Sum(DISTINCT{$<visits = {">0"}>} [User])

Any thoughts?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Add {1} to an expression to ignore all selections: Count( {1} distinct User)


I'm also guessing that there is only data for users for the dates they actually visited. So if you select a date you cannot select users with a visit value of 0 since there is no data for the users you're looking for. If that's correct then you should be able to calculate the number of non-visiting users with count({1-<visits={'*'}>} User).


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Try using the count function:

  • Count(distinct User)
  • Count({$<visits= {">0"}>} distinct User)

talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert Wassenaar that did seem to do something good!

I have added a third box that would display number of users NOT accessing the site using:

Count(DISTINCT{$<visits = {"0"} >} DISTINCT User)

It displays 0 every time I make a selection.

The two boxes (Total no of users and Total no of users accessing) are displaying the same value every time I make a date selection. The first box should give me total number of users for the entire dataset but it doesn't, it only counts users that accessed the site on the date I selected. Any idea how to get that fixed?

Gysbert_Wassenaar

Add {1} to an expression to ignore all selections: Count( {1} distinct User)


I'm also guessing that there is only data for users for the dates they actually visited. So if you select a date you cannot select users with a visit value of 0 since there is no data for the users you're looking for. If that's correct then you should be able to calculate the number of non-visiting users with count({1-<visits={'*'}>} User).


talk is cheap, supply exceeds demand