New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor

Finding string attached to Max value

Hi,

I am trying to build a KPI where the KPI displays the name of the customer of which a firm charges the highest amount of hours of service, as well as the actual amount of hours charged over a period of time. Since I am really new to Qlik, and after extensive searching led nowhere, I now turn to the community for help. An example of my table is as follows:

Name              Hours charged during period (ChgHr)

Company A     125

Company B     345

Company C     255

The hours charged during period is calculated with: Max(aggr(Sum(ChgHr),Name)) and returns 345.

My question(s) is(are): What expression do I write under label to find the name, and present it as a string, of the company tied to the maximum value of hours charged (ChgHr)? Is it even possible?

Thanks

1 Solution

Accepted Solutions
MVP

Re: Finding string attached to Max value

Try this

FirstSortedValue(Name, -Aggr(Sum(ChgHr), Name))

3 Replies
MVP

Re: Finding string attached to Max value

Try this

FirstSortedValue(Name, -Aggr(Sum(ChgHr), Name))

New Contributor

Re: Finding string attached to Max value

Thanks Sunny, that worked swell.

Cheers

Honored Contributor III

Re: Finding string attached to Max value

May be, try this -

=Only({<ChgHr={\$(=Max(Aggr(Sum(ChgHr),Name)))}>}Name)