5 Replies Latest reply on Feb 20, 2016 3:18 PM by Shinichiro Murakami

# Struggling to visualise Top N within a category

Hi all,

I am (still) working on my first viz, and I struggling to visualise one point properly, namely the I don't seem to be able to  find a top N within a category.

My viz (attached) is about political positions within the EU national parliaments. In my data source I have the following data: country/ political party/ # of seats in the parliament/ political position.

What I am trying to visualise is a predominant political position within the national parliaments and show it in the filled map (so different colour per each political position, eg. if centre-right parties are predominant in a national parliament that country is coloured blue etc). First I tried to assign MAX to political position, and when that didn't work I had a look at this community forum and tried to create a calculated field, but somehow I still find it wrong.

Any advice would be appreciated!

Thank you in advance!

Agata

• ###### 2. Re: Struggling to visualise Top N within a category

Hi,

thanks for this. Yes, tried this already Thanks for your reply tho

• ###### 3. Re: Struggling to visualise Top N within a category

Sorry, I misunderstood your needs, just judged by title.

[LOD seats by (Position by Country)]  // Calculate # of max seats of (country x Position)

{fixed [Country]:max({fixed [Country],[Political Position]: sum([Seats])})}

[Max Pos by Country]

if [LOD seats by (Position by Country)]

={fixed [Country],[Political Position]:sum([Seats])}

then ([Political Position]) end

Put [Max Pos by Country] to the color.

Thanks,

Shin

9.2 attached.

2 of 2 people found this helpful
• ###### 4. Re: Struggling to visualise Top N within a category

Hi Shin,

this is exactly what I was going for - thank you so much! I still need to learn a lot about creating calculated fields -.-

Thanks again!

Agata

• ###### 5. Re: Struggling to visualise Top N within a category

Sounds good.

I forget to attach link of LOD explanations.

Level of Detail Expressions

Anyway, LOD is very powerful calculation tool.  I hope you enjoy learning it.

If it's OK, could you put correct answer on the thread for other guys to understand it's answered.

Shin