Getting the record containing the maximum value of a specified field #eg57
Judy
Posted on October 14, 2024
Get the record containing the maximum value of a specified field, such as finding the nation that holds the first place on the Olympic Medal Table for the longest time.
maxp() function is used to get the record containing the maximum value.
SPL script:
A1 Retrieve the Olympic medal count table;
A2 Sort A1’s table by game and total medal count in descending order;
A3 Get one record, which is the first one of the ordered records, from each game;
A4 Group A3’s records by nation;
A5 Get the longest group, which has the nation occupying the first place for the longest time.
Execution result:
💖 💪 🙅 🚩
Judy
Posted on October 14, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
programming Copy The Other Rows in a Text File the Times Which Is the Number in the Last Row #eg65
October 25, 2024
programming Getting the record containing the maximum value of a specified field #eg57
October 14, 2024