Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jamelmessaoud
Creator II
Creator II

First Sorted Value (Again!)

Another question.

If this expression brings back more than one result

=firstsortedvalue([Sub Contractor], -Aggr(Sum({<[Sub Contractor Type] = {'Base Rate'}>}[Sub Contractor Rate]),[Sub Contractor]))

The result is showing null.

Is there a way to show more than one Sub Contractor using this expression?

Thanks

J

1 Solution

Accepted Solutions
sunny_talwar

You want the sub contractor from the min date or max date? For min... you can try this

Concat({<[Sub Contractor Type] = {'Base Rate'}>} Aggr(If(Sum({<[Sub Contractor Type] = {'Base Rate'}>}[Sub Contractor Rate]) = Min(TOTAL Aggr(Sum({<[Sub Contractor Type] = {'Base Rate'}>}[Sub Contractor Rate]), [Sub Contractor])), [Sub Contractor]), [Sub Contractor]), ', ')

View solution in original post

5 Replies
sunny_talwar

Use Concat() instead

Concat({<[Sub Contractor Type] = {'Base Rate'}>} Aggr(If(Sum({<[Sub Contractor Type] = {'Base Rate'}>}[Sub Contractor Rate]) = Max(TOTAL Aggr(Sum({<[Sub Contractor Type] = {'Base Rate'}>}[Sub Contractor Rate]), [Sub Contractor])), [Sub Contractor]), [Sub Contractor]), ', ')

jamelmessaoud
Creator II
Creator II
Author

Hi Sunny,

That doesn't quite do what I want.  The expression which you helped me with earlier worked perfectly

Min(Aggr(Sum({<[Sub Contractor Type] = {'Base Rate'}>}[Sub Contractor Rate]), [Sub Contractor]))

In an ideal world I want to pull back the Sub Contractors from this same expression if it's possible?

Thanks

J

sunny_talwar

You want the sub contractor from the min date or max date? For min... you can try this

Concat({<[Sub Contractor Type] = {'Base Rate'}>} Aggr(If(Sum({<[Sub Contractor Type] = {'Base Rate'}>}[Sub Contractor Rate]) = Min(TOTAL Aggr(Sum({<[Sub Contractor Type] = {'Base Rate'}>}[Sub Contractor Rate]), [Sub Contractor])), [Sub Contractor]), [Sub Contractor]), ', ')

jamelmessaoud
Creator II
Creator II
Author

It works Sunny.  Changed the max to min!!

Concat({<[Sub Contractor Type] = {'Base Rate'}>} Aggr(If(Sum({<[Sub Contractor Type] = {'Base Rate'}>}[Sub Contractor Rate]) =

min(TOTAL Aggr(Sum({<[Sub Contractor Type] = {'Base Rate'}>}[Sub Contractor Rate]), [Sub Contractor])), [Sub Contractor]), [Sub Contractor]), ', ')

jamelmessaoud
Creator II
Creator II
Author

You beat me to it!