4 Replies Latest reply on Apr 23, 2018 1:29 AM by Akshita Jain

# Logic to accomodate tie situation

Hi,

I have a requirement where I need to show a bar chart which will show top 3 managers who have higher number of outliers. However, if all these managers have same% of outliers then  shortlisting of team manager will be based on headcount. Now, If again ties occur at headcount level team manager will be appearing in alphabetical order.

Look forward to your response. Attached is the tableau file where I tried implementing this logic. However, I could not get success.

• ###### 1. Re: Logic to accomodate tie situation

Hi Akshita,

I can think of a pretty easy way to to this but it depends a bit on the data structure. The general idea is to use the pieces you want to build your rank on to come up with the arithmetic needed to sort by. For example in your data structure does not change (meaning a new manager with number M12312312312 cannot be added, they follow the current structure and let's say will never go above M1000) Based on this you can compute rank on something like ([Outlier%]*100000000)+([Headcount]*1000)+max(int(REPLACE([TM Name],"M",""))). This is a way to add "weight" to each piece of the equation to make it each additional piece "less impact" then the previous one. This is an example (which works with your data set) but it's mainly to illustrate the approach.

Best,

VP

• ###### 2. Re: Logic to accomodate tie situation

Hi, it will not work. Manager name will not be fixed. It is subjected to change as data will be refreshed daily.

• ###### 3. Re: Logic to accomodate tie situation

Hi Ashita,

You don't really need the 3rd part, you can sort the managers alphabetically and use the outlier+headcount metric for rank. See attached for example.

Note that because of the manager text alphabetically M75 is before M577. If you want the sorting to use the numbers instead of the string just create a new field that removes M and ints and sort the name by that.

Best,

VP

• ###### 4. Re: Logic to accomodate tie situation

Hi Vasil, thanks for your response. Could you please attach screenshot for the same as I am not able to open that file.