user1990606
user1990606

Reputation: 1

Percentage from Total Distinct Users in Tableau

This is a question about Tableau Desktop.

I have the following table: date, userid, applicationid

The table contains thousands of users working with 100 different applications.

I want to pick an application and show what percentage of ALL users used that application on a given day.

The issue that I am facing is that when the worksheet is filtered to only show my one app, the total number of users reflects the number of users that use that specific app.

Any advice is very welcome.

Upvotes: 0

Views: 2710

Answers (2)

mittu
mittu

Reputation: 83

Right click the percent of total pill (on the labels shelf) and select "Edit Table Calculation" and then select "Customize".

You will see it is:

COUNTD([Customer]) / TOTAL(COUNTD([Customer]))

Change that to:

COUNTD([Customer]) / WINDOW_SUM(COUNTD([Customer]))

Upvotes: 0

Inox
Inox

Reputation: 2275

As Alex precisely said, this problem is easier to solve in Tableau 9.0. All you need is to create a field [Total Users] and do like:

{ COUNTD(userid) }

Don't forget the braces.

Then, you can use COUNTD(userid) / [Total Users] (or max([Total Users]) if Tableau pick on the aggregation thing)

If you don't have Tableau 9.0, one solution is to use table calculations. Create a [# users] field:

COUNT(userid)

Drag it to the worksheet, also drag the applicationid as a dimension, and add a table calculation to # users, percent of total.

Now, if you filter out some applicationids, you'll have problems, so I recommend you not to filter out anything, but instead right click on the dimension and choose Hide. It will still be considered in calculations but will not appear on chart.

Another solution (to filter out) is to create a table calculation filter. Tableau will always do the table calculations last, so table calculation filters will be the last thing Tableau will do, and therefore won't exclude anything from other calculations in the worksheet.

So a filter with a field like:

LOOKUP(MAX(applicationid), 0)

Could filter the applicationids, without affecting the percent of total calculation.

Upvotes: 1

Related Questions