4 Replies Latest reply on Mar 5, 2012 12:18 PM by Alan Kwan

# Ranking with 2 dimensions

So I have two dimensions and one measure,

Dimensions: State, Agent Name

Measure: Duration

State     Agent               Duration

a               1                         1

2                         4

b               2                         2

3                         6

c               3                         3

5                         1

I don't know how to create a ranking that ranks the agent within the state.

So with the example on the top, the result should be:

State   Rank  Agent               Duration

a           2         1                         1

1         2                         4

b           2         2                         2

1        3                         6

c           1         3                         3

2        5                         1

I understand using the index() formula will give me the numbers, but it won't sort according to their sum of durations..please help

Thanks,

Alan

• ###### 1. Re: Ranking with 2 dimensions

Hi Alan,

This KB article should help:

http://kb.tableausoftware.com/articles/knowledgebase/finding-top-n-within-category

Let me know if you have further questions!

-Tracy

• ###### 2. Re: Ranking with 2 dimensions

Hi Tracy,

Thanks for your quick reply. I tried it, and only the first half works. I managed to get all the records to sort according to their sum in each pane.

However, when I get to step 10 of the setting up custom filter part,  instead of giving me 1,2,3,4,5,6 on the running sum of minimum number of records, it gives 1,1,1,1,1,1 throughout. How come?

Thanks,

Alan

• ###### 3. Re: Ranking with 2 dimensions

Hi Alan,

I'd have to see your workbook, but my guess is you need to change how the table calculation is being computed. Right click on the calculation and select Compute Using--> then Pane (Down)---depending how your view is set up this might be different. If this doesn't work, maybe you can post your workbook (twbx file)? Hope this helps!

-Tracy

• ###### 4. Re: Ranking with 2 dimensions

Ok found the problem. The reason was because on step of creating the set, i duplicated the two dimensions instead of duplicating only the higher level one. Thus using the duplicated fields as the set.

Not sure whats the logic behind this is, but thats the reason.

Thanks Tracy.