Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to show highest total as KPI?

Hi,

I have Students as dimension and their marks total as expression.

Dimension: Students

expression: Sum(Marks)

I would need to show the KPI of which student has highest total. Please let me know is this possible?

I used below. Is this correct expression?

If(Total>0,'qmem://<bundled>/BuiltIn/led_g.png','qmem://<bundled>/BuiltIn/led_r.png')

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Change your KPI expressions as below..

If(Rank(Aggr(SUM(Marks),Student))= 1,'qmem://<bundled>/BuiltIn/led_g.png','qmem://<bundled>/BuiltIn/led_r.png')

View solution in original post

6 Replies
MK_QSL
MVP
MVP

Please upload your sample file ...

Not applicable
Author

Please find attached.

MK_QSL
MVP
MVP

Change your KPI expressions as below..

If(Rank(Aggr(SUM(Marks),Student))= 1,'qmem://<bundled>/BuiltIn/led_g.png','qmem://<bundled>/BuiltIn/led_r.png')

Not applicable
Author

Hi Amelia

To return the maximum total marks by student, within the table you could use the expression

 

max(total aggr(sum(Marks),Student))

I've wrapped the sum(Marks) in an Aggr function by student, using the total to work it out across the whole table.

Putting this expression in an if statement and comparing with their marks would enable you to mark out the student with the greatest mark:

if( max(total aggr(sum(Marks),Student))  = sum(Marks),'Highest Student','Not highest student')

Erica

Not applicable
Author

Hi Amelia,

here is my Suggestion for your expression:

if(Rank(Sum(Marks)) = 1 ,'qmem://<bundled>/BuiltIn/led_g.png','qmem://<bundled>/BuiltIn/led_r.png')

Regards

Roland

Not applicable
Author

Thanks and that's right.