Announcements
Product Release Webinar: Qlik Insider airing December 6! REGISTER TODAY!
cancel
Showing results for
Did you mean:
Specialist II

## Display the member with maximum invoice in a text object

Hi,

I have a table with structure

Name    Invoicenumber

aaa          123

aaa         123

aaa          123

bbbb       123

i need to display only the name which processed maximum number of invoices in a text object

Regards

1 Solution

Accepted Solutions
MVP

Try

= FirstSortedValue( aggr(Name,Name)    , aggr(-count(Invoicenumber),Name) )

7 Replies
Specialist II
Author

= FirstSortedValue(Name    , - max(Count(Invoicenumber) )

but it is saying error in expreession

MVP

Try

= FirstSortedValue( aggr(Name,Name)    , aggr(-count(Invoicenumber),Name) )

Specialist II
Author

Thanks Swuehl

It worked like charm

Regards

Specialist II
Author

Hi One more Qn.

How to find minimum of average?

= FirstSortedValue( aggr(Name,Name)    , aggr(-min(avg(Invoicenumber)),Name) )

Regards

MVP

What should the avg(Invoicenumber) return [given your above sample data]? 123?

Specialist II
Author

Hi swuehl

Not for that data I am using some other and data and found the average of time they are utilizing for processing certain invoices .

and now I need to show the member who is having least average response time (i.e) High Productivity.

= FirstSortedValue( aggr(ModBy,ModBy)    , aggr(min((-avg(Diff))),ModBy) )

Regards

MVP

Then try

= FirstSortedValue( aggr(ModBy,ModBy)    , aggr( avg(Diff),ModBy) )

FirstSortedValue() will return the min value sorted by your sort weight avg(Diff), if you want to get the max, add the minus sign.

And if you can have multiple ModBy's with the same min sort weight, FirstSortedValue won't return anything, to get at least one, add a DISTINCT qualifier:

= FirstSortedValue(DISTINCT  aggr(ModBy,ModBy), aggr( avg(Diff),ModBy) )

Community Browser