9 Replies Latest reply on Jun 17, 2015 8:12 AM by Jesse yung

# Calculate number of stores which meet the top category criteria

hi, i have a table like this

 Store Product Amount Day A Apple 116 1 A Banana 83 1 B Apple 135 1 B Pineapple 147 1 B Pear 86 1 C Apple 139 1 C Apricot 54 1

for each day, how can i obtain how many stores are there having apple as their top product?

Desired output

Day1Day2
# (no. of stores)#

Thanks

• ###### 1. Re: Calculate number of stores which meet the top category criteria

9.0 or 8.2

1 of 1 people found this helpful
• ###### 2. Re: Calculate number of stores which meet the top category criteria

have both. if LOD can solve it, would be great.

• ###### 3. Re: Calculate number of stores which meet the top category criteria
1 of 1 people found this helpful
• ###### 4. Re: Calculate number of stores which meet the top category criteria

hi Alexander, this looks great. However, I wasn't able to replicate your results. anything i missed out?

• ###### 5. Re: Calculate number of stores which meet the top category criteria

Jesse,

In [Win Count]'s table calculations, there are two variables to be set:

- Rank U is set to compute using Produce

- Win Count is set to compute using Store

Then control-drag [Win Count] to filter shelf. Configure it by Special>Non-Null Values

That's it.

1 of 1 people found this helpful
• ###### 6. Re: Calculate number of stores which meet the top category criteria

An alternative solution

https://public.tableau.com/views/CountbyTopProduce_AM2/Sheet2?:embed=y&:showTabs=y&:display_count=yes

On Mon, Jun 15, 2015 at 7:51 AM, Jesse yung <

1 of 1 people found this helpful
• ###### 7. Re: Calculate number of stores which meet the top category criteria

thanks a lot! however, my main block is where to place 'rank'. it doesn't appear on any shelf.

This is my step by step:

i place store/produce/rank u to row shelf, set rank to calculate by produce. so far the ranking works ok.

then i drag win count to text mark to calculate by store. it doesn't work. it's showing 1 instead of 3.

anything wrong?

• ###### 8. Re: Calculate number of stores which meet the top category criteria

Rank is part of Win Count. It doesn't need to be on any shelf.

1.Right click Win Count to edit table calculations

2.Using the drop down menu on top of the editor to set addressing for both Win Count (using store) and Rank U (using produce).

• ###### 9. Re: Calculate number of stores which meet the top category criteria

genius!