我有一张两列的桌子。现在,我想选择比上一行“更少”的行。就像。
A/B
2/2-1
2-2-2
2/2-4
2至8
2/2-9
3/ 12
3/12
1/1/ 16
我想选择中的"1“行,因为它比以前的少,我可以通过创建新列来选择行,但是我可以在其中寻找一些内容。
发布于 2013-07-17 19:36:54
data want;
set have;
by a notsorted;
if first.a then flag=ifn(a lt lag(a),1,0); *ifn allows lag to work here - excel style if;
run;它将标识集合中第一行的行,且其值a小于a的前一个值。然后可以通过want对flag=1进行筛选。
https://stackoverflow.com/questions/17708674
复制相似问题