3 Replies Latest reply on Jan 23, 2012 7:56 AM by Jonathan Drummey

# Top user by company by total logins

I apologize in advance for not being able to provide any visuals/workbooks, I'm posting this from my 3G iPad while in jury duty and there's no wifi to post from my laptop. Just trying to stay productive.

I'm looking to create a sheet that will display the top X users by total logins for each company. I've got the right view set up:

Looks like this:

Comp A | J. Smith | ------------------

|  J. Doe | ----------

Comp B | x.        | -------------------

| y.          | -----------

| z.          | ------

I want to only display the top user for each company to have it look like this:

Comp A | J. Smith | ------------------

Comp B | x.        | ----------

If I do a top filter on username by login field, it filters across all companies. So it would give me the top user across all companies, not the top user for EACH company. How can I do that?

Hope my make shift visuals made sense!

Thanks

Chris

• ###### 1. Re: Top user by company by total logins

I've been wanting to learn more about the INDEX() function, this seemed like a good way to start. To get the top 1, all you need is an INDEX() with the table calculation appropriately partitioned. However, to show a top N and have them appropriately sorted I had to create a set to do the nested sort. I've attached a workbook (Tableau 7.0 format) that does this with the Superstore Sales data using a set to create the nested sort on Region/Customer and then using the INDEX() function to grab the top customer by # of sales in each region. I used these references to create the workbook:

Creating a nested sort:

http://kb.tableausoftware.com/articles/knowledgebase/nestedsorting

How-to from Joe Mako on appropriately setting table calc fields:

Also, here's an alternative method of calculation from an older file: http://www.tableausoftware.com/files/tips/pdf/TopSalesPerRegion.pdf

Jonathan

• ###### 2. Re: Top user by company by total logins

Thanks so much for your post! The 3rd link you posted was EXACTLY what I needed!

Have a great day!

-Chris

• ###### 3. Re: Top user by company by total logins

You're welcome!