Aggregation with FirstSortedValue

estimate_number,est_rev_nbr,description,amount
307,0,Hotel,500
307,1,Hotel,1000
307,2,Hotel,1500
307,0,Flight,200
307,1,Flight,300
307,2,Flight,400
307,3,Flight,500
How to show Hotel (1500) and Flight (500) values?
Solution: Sum(Aggr(FirstSortedValue(amount, -est_rev_nbr), description))

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.