Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for
Did you mean:
Contributor III

## Count according to rank

I have the following data which shows sales and growth for 3 products with respect to different cities. I need to find the count of cities in which product A is number 1 (according to growth) with respect to other products.

** Growth has been calculated separately  by using formula (Current Year Sales-Previous Year Sale)*100/Previous Year Sales.

 City Product A Sales Product A Growth Product B Sales Product B Growth Product C Sales Product C Growth A1 75274 86 193401 1 46683 61 A2 126887 88 157545 61 196406 40 A3 126043 73 64573 86 131707 70 A4 120066 49 53935 97 163663 18 A5 215567 59 108608 89 15006 100 A6 216918 83 110127 91 74523 59

I want to show output in sepearate KPI .

Output should be like:-

No. of cities in which Product A is no. 1:- 2

No. of cities in which Product B is no. 1:- 3

No. of cities in which Product C is no. 1:- 1

Labels (1)
• ### count according to rank

8 Replies

Based on above data what should be the expected output? Where you want to show that?

Contributor III
Author

I want to show output in sepearate KPI .

Output should be like:-

No. of cities in which Product A is no. 1:- 2

No. of cities in which Product B is no. 1:- 3

No. of cities in which Product C is no. 1:- 1

what is the definition of No 1 product? Based on Growth, how you are counting cities 2 product A?

MVP

Do you have multiple columns for Product (Product A, Product B, etc) or do you have a single Product column which contains values as Product A, Product B,... etc?

Contributor III
Author

Multiple columns for Product

Contributor III
Author

No. 1 means the cities where growth is maximum for product A(w.r.t to product B and product C)

MVP

Can you transform your data using The Crosstable Load so that you have a single column for Products?

Please provide some sample data to work with