Hi All,
I am looking to get a rank column as shown below using some rank functions.
We have to group all same locations and rank within the group.
Then, the lowest sales should get the first rank. If the sales are same, the rank should be given based on the second Column Amount.
For example, Sydney have sales as 1000 in two cases. So we checked Amount and given rank 2 to the entry that is having higher amount.
Basically, Sales in ascending and amount in descending order within a group(Same Location). you help is highly appreciated.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Location[/TD]
[TD]Sales[/TD]
[TD]Amount[/TD]
[TD]Rank[/TD]
[/TR]
[TR]
[TD]Sydney[/TD]
[TD]850[/TD]
[TD]10000[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Sydney[/TD]
[TD]1000[/TD]
[TD]12000[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Sydney[/TD]
[TD]1000[/TD]
[TD]11000[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Canada[/TD]
[TD]5000[/TD]
[TD]50000[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Canada[/TD]
[TD]4500[/TD]
[TD]45000[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Canada[/TD]
[TD]5000[/TD]
[TD]35000[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]
I am looking to get a rank column as shown below using some rank functions.
We have to group all same locations and rank within the group.
Then, the lowest sales should get the first rank. If the sales are same, the rank should be given based on the second Column Amount.
For example, Sydney have sales as 1000 in two cases. So we checked Amount and given rank 2 to the entry that is having higher amount.
Basically, Sales in ascending and amount in descending order within a group(Same Location). you help is highly appreciated.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Location[/TD]
[TD]Sales[/TD]
[TD]Amount[/TD]
[TD]Rank[/TD]
[/TR]
[TR]
[TD]Sydney[/TD]
[TD]850[/TD]
[TD]10000[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Sydney[/TD]
[TD]1000[/TD]
[TD]12000[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Sydney[/TD]
[TD]1000[/TD]
[TD]11000[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Canada[/TD]
[TD]5000[/TD]
[TD]50000[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Canada[/TD]
[TD]4500[/TD]
[TD]45000[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Canada[/TD]
[TD]5000[/TD]
[TD]35000[/TD]
[TD]3[/TD]
[/TR]
</tbody>[/TABLE]