如何转调 EG5.1

发布于 2025-01-15 08:28:27 字数 725 浏览 4 评论 0原文

我有一个大约以下格式的数据集:

表格式:

ID201220132014
A13
B24

我想将其转置为以下格式:

表格式:

IDSourceValue
A20121
A20133
B20122
B20144

使用转置任务。我正在 EG 5.1 中工作,但我对如何做到这一点有很大的心理障碍。大多数指南都是以相反的方式进行此操作。预先非常感谢您的任何建议。

I have a data set of approximately this format:

Table format :

ID201220132014
A13
B24

And I want to transpose it to this format:

Table format :

IDSourceValue
A20121
A20133
B20122
B20144

Using the Transpose task. I'm working in EG 5.1 and I've got a massive mental block on how to do this. Most of the guides are for doing this the opposite way around. Thanks so much in advance for any advice.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

远山浅 2025-01-22 08:28:27

使用 proc transpose 来代替。创建一个新的 SAS 程序并运行以下代码:

proc transpose data = have
               out  = want(rename = (COL1 = Value)  
                           where  = (NOT missing(Value) )
                          )
               name = Source;
    by id;
    var _NUMERIC_;
run;

输出:

ID  Source  Value
A   2012    1
A   2013    3
B   2012    2
B   2014    4

在 Enterprise Guide 中,这是 Stack Columns 任务:

在此处输入图像描述

Use proc transpose instead. Create a new SAS program and run the following code:

proc transpose data = have
               out  = want(rename = (COL1 = Value)  
                           where  = (NOT missing(Value) )
                          )
               name = Source;
    by id;
    var _NUMERIC_;
run;

Output:

ID  Source  Value
A   2012    1
A   2013    3
B   2012    2
B   2014    4

In Enterprise Guide, this is the Stack Columns task:

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文