重新编码脚本在使用 post query scipt 从 sql 服务器中提取数据后,我尝试重新编码数据(0 到 .)。 我的脚本末尾出现错误。 我可以在数据表本身上运行脚本,但希望在输入数据时自动发生。
这是我的脚本。
将属性添加到表(
{新脚本(
“重新编码” ,
当前数据表() <<开始数据更新;
对于每一行(:纯度_2 =匹配(:纯度_2, 0 , 。 , 。 , 。 , :purity_2 ) );
对于每一行(:纯度_3 =匹配(:纯度_3, 0 , 。 , 。 , 。 , :purity_3 ) );
对于每一行(:纯度_4 =匹配(:纯度_4, 0 , 。 , 。 , 。 , :purity_4 ) );
对于每一行(:plus50_2 =匹配(:plus50_2, 0 , 。 , 。 , 。 , :plus50_2 ) );
对于每一行(:plus100_2 =匹配(:plus100_2, 0 , 。 , 。 , 。 , :plus100_2 ) );
对于每一行(:plus140_2 =匹配(:plus140_2, 0 , 。 , 。 , 。 , :plus140_2 ) );
当前数据表() <<结束数据更新
}
这是错误消息:
输入意外结束。 也许缺少“,”或“)”。
尝试解析函数“将属性添加到表”的参数。
第 60 行第 45 列:当前数据表() << 数据更新结束;)}►
谢谢,
回复:重新编码脚本编辑:忽略这一点,它与上面吉姆的帖子相同。
您还可以将新脚本消息直接发送到表:
dt << New Script(
"Recode 2",
Current Data Table() << Begin Data Update;
For Each Row( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
For Each Row( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
For Each Row( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
For Each Row( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
For Each Row( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
For Each Row( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
Current Data Table() << End Data Update;
);
回复:重新编码脚本您需要将其作为消息发送到您的数据表。这是一种方法:
dt = current data table();
dt << Add Properties to Table(
{New Script(
"Recode",
Current Data Table() << Begin Data Update;
For Each Row( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
For Each Row( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
For Each Row( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
For Each Row( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
For Each Row( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
For Each Row( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
Current Data Table() << End Data Update;
)});
回复:重新编码脚本我在使用“将属性添加到表()”方面并没有真正的经验,但是在阅读脚本索引中的定义时,您想要做的事情似乎不起作用。您的脚本的以下简化将起作用
Names Default to Here( 1 );
Current Data Table() << New Script(
"Recode",
Current Data Table() << Begin Data Update;
For Each Row( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
For Each Row( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
For Each Row( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
For Each Row( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
For Each Row( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
For Each Row( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
Current Data Table() << End Data Update;
);
回复:重新编码脚本这不起作用,我收到以下消息。
将属性添加到表(
{新脚本(
“重新编码”,
当前数据表() << 开始数据更新;
对于每一行( :purity_2 = Match( :purity_2, 0, ., ., ., :purity_2 ) );
对于每一行( :purity_3 = Match( :purity_3, 0, ., ., ., :purity_3 ) );
对于每一行( :purity_4 = Match( :purity_4, 0, ., ., ., :purity_4 ) );
对于每一行( :plus50_2 = Match( :plus50_2, 0, ., ., ., :plus50_2 ) );
对于每一行( :plus100_2 = Match( :plus100_2, 0, ., ., ., :plus100_2 ) );
对于每一行( :plus140_2 = Match( :plus140_2, 0, ., ., ., :plus140_2 ) );
当前数据表() << 数据更新结束;
)}
) /*###*/;
回复:重新编码脚本你最后缺少一个右括号。
Current Data Table() << End Data Update;)}<STRONG>);</STRONG>