how to get their rank by different group in dataset ??


in Help
I have a file ( row id, shop id, product id, totalsale)
1, A101, vegetable, 200K
2, A101, meat, 400K
3, A101, drink, 300K
4, B203, vegetable, 50K
5, B203, vegetable, 100K
6, B203, vegetable, 20K
how to get their rank by different shop group in dataset ??
the desired result :
1, A101, vegetable, 200K, 3(rank in A101 shop)
2, A101, meat, 400K, 1
3, A101, drink, 300K, 2
4, B203, vegetable, 50K, 2
5, B203, vegetable, 100K, 1
6, B203, vegetable, 20K, 3
Need help !
1, A101, vegetable, 200K
2, A101, meat, 400K
3, A101, drink, 300K
4, B203, vegetable, 50K
5, B203, vegetable, 100K
6, B203, vegetable, 20K
how to get their rank by different shop group in dataset ??
the desired result :
1, A101, vegetable, 200K, 3(rank in A101 shop)
2, A101, meat, 400K, 1
3, A101, drink, 300K, 2
4, B203, vegetable, 50K, 2
5, B203, vegetable, 100K, 1
6, B203, vegetable, 20K, 3
Need help !
1
Answers
I am not aware of a straightforward way to have a grouped rank attribute, but, you can achieve this by utilizing the loop values operator that loops over unique values, which is not much of a hassle aswell. Check out the mock XML of how the process would look like below.
Harshit
Group Into Collection by ShopId, Loop Collection, Sort (by totalsale) and append it again.
Dortmund, Germany