cancel
Showing results for 
Search instead for 
Did you mean: 

about For each context

Former Member
0 Kudos

hello gurus..

                  here my requirement is ... i am taking objects as country,state,sales revenue in web intelligence..i drag & drop" yr,sales revenue"

but i want max state sales revenue instead of yrs sales revenue...so i have used for each formula    {    =max([sales revenue]) foreach([state])   }

now it gives max state sales revenue but i want that state name too....

Accepted Solutions (0)

Answers (2)

Answers (2)

arijit_das
Active Contributor
0 Kudos

You can use the above formula but it can give you #MULTIVALUE in case of tie.

If you are likely to face such problem, you can use another way:

  1. Drag Year, State and Sales Revenue in table.
  2. Create a variable: v_Rank = Rank([Sales revenue];[State];([Year]))
  3. Create a block level filter as v_Rank Equal to 1.

This will give you separate rows for states in case of tie.

Former Member
0 Kudos

For your purpose you can use following formula:

=[State] Where(Rank([Sales revenue];[State];([Year]))=1)

I hope this will help you.

Thanks,

Swapnil