Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
merry2018
Creator III
Creator III

Top1 und Top2 in je einer Spalte anzeigen

Hello Togehter,

i ned your help, for get the korrekt formul in a diagram.

There are more departments, with each more people, and I would like to see only the oldest and the secound oldest each department. And that in a table like this:

Department People Age
Personal Daniel 25
Personal David 22
Management Daniela 46
Management Maria 40
Financial Marion 35
Financial Tom 17
Production Alex 12
Production Tina 11
Informatik Tim 46
Informatik Martin 45

 

There are more People: (which not shown in the Table):

Management Max 35
Financial Thomas 15
Financial Franz 12
Production Max 10

 

I tried to show the first Table, with the Formul: 

top(sum(Age),1,2)

 

But it doesn't work.

 

Regards 
Merry

Labels (2)
2 Replies
merry2018
Creator III
Creator III
Author

Respectively the table above I get over the constraint condition, I actually want the table to look like this:

Department People TOP1 Age People TOP2 Age
Personal Daniel 25 David 22
Management Daniela 46 Maria 40
Financial Marion 35 Tom 17
Production Alex 12 Tina 11
Informatik Tim 46 Martin 45

 

merry2018
Creator III
Creator III
Author

=Aggr(if(rank( sum(Age) ) =1, Person &' ('&( sum(Age)) &')'), Depatrment, Age)

because if there are two Age for the first Place, it show nothing from them.

Who have an idea, to show some like that:

Department People TOP1 Age People TOP2 Age People TOP3 Age
Personal Daniel 25 Darius 25 Tami 20
Management Daniela 46 Tali 40 Maria 40