Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Firstsortedvalue Max

Hi,

I have data which shows the price (field name Price) bid in different markets.

I would like to create an expression which returns the below for each of the highest Prices:

MarketMaker, Price, Quantity

I thought it would be something like FirstSortedValue(MarketMaker,-aggr(Max(C1Price),MarketMaker)), however this doesn't always return a value.  Would this expression not work if more than one value are the maximum Price?

Regards,
Daniel

5 Replies
Anil_Babu_Samineni

How about simply this?

FirstSortedValue(MarketMaker, -Price)

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
danielnevitt
Creator
Creator
Author

Thanks again for the quick reply.

Would that expression work if there are more than one value with the maximum price?  Also does it recognise negative values?

Thanks

Anil_Babu_Samineni

I can say yes for both cases.

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
danielnevitt
Creator
Creator
Author

Sorry another quick question.

Is there a way to calculate the firstsortedvalue when the Executed field = Y.

Something like FirstSortedValue({Executed={'Y'},Buyer,-Price)?

Thanks,
Daniel

Anil_Babu_Samineni

Yes, Perhaps this way

FirstSortedValue(Buyer,-Sum({<Executed={'Y'}>} Price))

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)