如何在Microsoft Excel Power查询中找到每个ID的最大值?
Job_ID | Day_id |
---|---|
430 | 120 |
430 | 720 |
530 | 120 |
530 | 620 |
620 | 630 |
120 630 | 120 |
630 | 620 |
630 | 620 |
应成为:
job_id | day_id |
---|---|
430 | 720 |
530 | 530 620 |
620 | 630 |
620 630 | 620 |
只有day_id的行中只有最大值。
我目前正在使用Excel的Power查询,因此不可用Python和R脚本。
JOB_ID | DAY_ID |
---|---|
430 | 120 |
430 | 720 |
530 | 120 |
530 | 620 |
630 | 120 |
630 | 120 |
630 | 620 |
630 | 620 |
Should become:
JOB_ID | DAY_ID |
---|---|
430 | 720 |
530 | 620 |
630 | 620 |
630 | 620 |
Where only the rows where day_id is the maximum value is kept.
I'm currently using Excel's Power Query, so Python and R scripts are not available.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为了将重复项保持在最后,您必须摆弄M。
To keep the duplicates at the end, you have to fiddle around with the M. Here you go.
您可能需要按JOB_ID进行分组,然后选择汇总最大day_id
编辑:(请参见下文评论)
与原始列表的匹配可以使Job_ID的重复与相同的最大day_id保持
You may want to group by Job_ID and choose to aggregate max Day_ID
edit: (see below comment)
matching against original list allows to keep duplicates of Job_ID with same max Day_ID