4.13 行式数据排名 - 按单字段
将成绩表按数学成绩计算排名
Class | Name | Maths |
---|---|---|
1 | Tom | 85 |
2 | John | 92 |
2 | Joan | 86 |
1 | Rocky | 95 |
2 | Ham | 92 |
1 | Kate | 83 |
1 | Rose | 95 |
2 | Nomy | 78 |
1 | Neil | 91 |
2 | Jack | 84 |
1 | Joe | 98 |
脚本:
A | |
---|---|
1 | =T(“score.xlsx”) |
2 | =A1.(Maths) |
3 | =A1.derive(A2.rank@z(Maths):Rank) |
A1 读数
A2 获得数学成绩列的值
A3 给 A1 添加排名列,用 A2 计算当前行的数学排名
运行结果:
Class | Name | Maths | Rank |
---|---|---|---|
1 | Tom | 85 | 8 |
2 | John | 92 | 4 |
2 | Joan | 86 | 7 |
1 | Rocky | 95 | 2 |
2 | Ham | 92 | 4 |
1 | Kate | 83 | 10 |
1 | Rose | 95 | 2 |
2 | Nomy | 78 | 11 |
1 | Neil | 91 | 6 |
2 | Jack | 84 | 9 |
1 | Joe | 98 | 1 |