Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Below is the sample data set, I want to create a straight table as shown in output.
Requirement: the country name which made the max sale for every year.
| Country | sales | Year |
| a | 100 | 2010 |
| b | 200 | 2010 |
| c | 300 | 2010 |
| d | 400 | 2010 |
| a | 800 | 2011 |
| b | 600 | 2011 |
| c | 700 | 2011 |
| d | 500 | 2011 |
| a | 100 | 2010 |
| b | 200 | 2010 |
| c | 300 | 2010 |
| d | 400 | 2010 |
| a | 800 | 2011 |
| b | 600 | 2011 |
| c | 700 | 2011 |
| d | 500 | 2011 |
output:
| year | country | sales |
| 2010 | d | 800 |
| 2011 | a | 1600 |
Thanks in advance ![]()
Regards,
Sundar
Anbu,
This is extremely awesome stuff.... ![]()
Thanks a lot ...
Regards,
-Sundar
This is better expr than Concat()
FirstSortedValue(Country,Aggr(-Sum(sales) ,Country,Year,prod))