5 Replies Latest reply: Feb 11, 2010 4:09 PM by Jean-Jacques Jesua

# Find the Max & get a related field

Hi,

My problem is simple but I can't find out a simple solution.

Suppose I have a table with 3 fields : Country, City , Number of Inhabitants

I'd like to create a straight table with

Country,

Name of the city which as the maximum of inhabitants for a country (or the minimum)

Of course, I don't want to do this in the script.

Jean-Jacques

• ###### Find the Max & get a related field

hi

try this example

hope its helps

regards

• ###### Find the Max & get a related field

Thanks a lot. The tip is to calculate the biggest city in the dimension area not in the expression,.

Do you have idea about the smallest city ?

Regards

Jean-Jacques

• ###### Find the Max & get a related field

hi

it took me some time to figure it out

but here is example inckuding tje minimum value

in both tables you can play with how many city per country you want to show

regards and good night

liron

• ###### Find the Max & get a related field

Shalom Liron,

Thanks for your time & i'm sure you deserve a good night.. It's perfect.

cheers

Jean-Jacques

• ###### Find the Max & get a related field

I found out in another post a tricky function FirstSortedValue.

=FirstSortedValue(city, NumInhbtians) give the smallest

=FirstSortedValue(city, - NumInhbtians) give the biggest