全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1017 4
2014-03-16
悬赏 20 个论坛币 已解决
Hi : Sir
   How to find it (the largest one)  using the 2-moving -MAX windows from pooling data by group ?
THS !

pooling.xls
group          month         sales
1001          199101          1
1001          199102          2
1001          199103          3
1001          199104          4
1003          199102         10
1003          199103           9
1003          199104           8
1003          199105           7
1004          199102          21
1004          199103          21
1004          199104          21
1004          199105          22
1004          199106          23

I hope below:
out.xls
group           month         MAX(2)
1001                   199101           .      
1001                   199102                   2
1001                   199103                   3
1001                   199104                   4
1003                   199102           .
1003                   199103          10
1003                   199104          10
1003                   199105          10
1004           199102            .
1004                   199103                  21
1004                   199104                  21
1004                   199105                  22
1004                   199106                  23

最佳答案

yongyitian 查看完整内容

This is for moving max of 12 rows. I am sure you can change it two, if you want.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-3-16 10:57:12
This is for moving max of 12 rows. I am sure you can change it two, if you want.
复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-3-16 12:27:17
复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-3-16 13:06:37
Can you rewrite code if temp{12} ?
The 12-moving -MAX windows
THS!
PS: Where is macro %missing in the code?


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-3-16 20:35:55
WROMG ! The the first maxsale by group  is = "."  


group               month                sales               maxsale
1001              199101                   1                   1
1001              199102                   2                   2
1001              199103                   3                   3
1001              199104                   4                   4
1003              199102                  10                  10
1003              199103                   9                  10
1003              199104                   8                   9
1003              199105                   7                   8
1004              199102                  21                  21
1004              199103                  21                  21
1004              199104                  21                  21
1004              199105                  22                  22
1004              199106                  23                  23
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群