Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

KPI chart and dimension for max value

Hi all.

I have a table like this one:

Layers:

Load*Inline [

Layer,    Amount

L1,          3

L2,         12

L3,         6

];

I have a KPI object to show Max(Layer) value. And I want to show as a label for this expression for which layer name this expression is related. Now it will be L2, but the next reload it may be the other one. So I need some dynamic in the label name. 
Can someone tell how to create dynamic label?

 

Labels (1)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

try this as title expression

=FirstSortedValue(Layer,-aggr(Max(Amount),Layer))

View solution in original post

4 Replies
Highlighted
Partner
Partner

try this as title expression

=FirstSortedValue(Layer,-aggr(Max(Amount),Layer))

View solution in original post

Highlighted
Creator II
Creator II

Thank you for help. It works. 
Can you, please, explain why there is a minus before Aggr? 

Highlighted
Partner
Partner

Aggr creates a virtual table and if you dont have minus the layer with least will be returned by first sorted value.

Highlighted
Creator II
Creator II

Understood. Thank you👍!