Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
eromiyasimon
Creator II
Creator II

Rank of Sale state wise and Rank of brand in the sale of state

Rank of Sale state wise and Rank of brand in the sale of state

i have a table which contains the sale of various brands among states

a brand can be sold in various states

now i need to get the rank of sale based on states

and the rank of brand for a state inside the total brand sale for a state

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Aggr(Rank(Sum({<Brand>}Sale),1,1), state, Brand)

Capture.PNG

What do you want to see when no Brand is selected?

View solution in original post

10 Replies
eromiyasimon
Creator II
Creator II
Author

Attached the Sample data stalwar1

sunny_talwar

the rank of brand for a state inside the total brand sale for a state

Can you elaborate on this with an example? Is this based on a selection made by the user? I mean I am not sure how to determine the rank and what numbers (based on the sample attached) is the expected output?

eromiyasimon
Creator II
Creator II
Author

hi sunny thanks for the reply

State wise Rank of the Selected Brand

i need to display the rank of sales based on states

this is without user selection

but when user select a particular brand

i need to display the rank of that brand within in the sale of a single state

the first highlight shows the rank of brand for a single state within its own sale

i need to display the user selected brand vice versa on the second highlighted area

thanks in advance

sunny_talwar

I am still not sure I follow. Lets say you selected Brand1, you can to see its rank across different states?

eromiyasimon
Creator II
Creator II
Author

in state 1 - brand 1 is in 3rd place

in state 2 - brand 1 is in 4th place

in state 3 - brand 1 is in 4th place

in state 4 - brand 1 is in 3rd place

in state 5 - brand 1 is in 3rd place

in state 6- brand 1 is in 2nd place

here im letting the user to select the brand

and i need to show the value vice versa

sunny_talwar

I think this is what you might be looking for

Capture.PNG

first 2 expressions are rank and sales across all brands and the last two are rank and sales for Brand1.

eromiyasimon
Creator II
Creator II
Author

Manually updated screen shot

sunny_talwar

Try this:

Aggr(Rank(Sum({<Brand>}Sale),1,1), state, Brand)

Capture.PNG

What do you want to see when no Brand is selected?

gowtham_patnaik
Contributor III
Contributor III

try this expression:

Rank of sale of state  =aggr(rank(sum({$<state={'*'}>}{$<Brand={'*'}>}Sale)),state)

Rank of sale of brand of state  ==rank(sum({$<state={'*'}>}{$<Brand={'*'}>}Sale))