Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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!