使用变量作为列名这应该是一个非常简单的问题,但它已经让我沮丧了几个小时,我无法弄清楚。我有一个脚本,它循环遍历列列表并为每个列构建各种图表。它还使用这行代码将分布添加到阵容框中。
当我手动输入列名称时,此行完美运行:
lub << append( Panel Box( "Distribution", db_Data << Distribution( Continuous Distribution( column( "VF (19)" )) ) ) );
但是当我尝试使用变量时这将不起作用:
TestName = "VF (19)";
lub << append( Panel Box( "Distribution", db_Data << Distribution( Continuous Distribution( column( TestName )) ) ) );
我尝试过使用
as column(TestName)
column( name(TestName))
column( as name(TestName))<BR />column( as :Name(TestName))<BR />column( :Name(TestName))
以及我可以在互联网上的讨论中找到的所有其他组合。但无济于事。有人可以帮忙吗?
高级统计建模自动化和脚本编写消费者和市场研究数据混合和清理数据探索和可视化回复:使用变量作为列名我尝试了这个解决方案,但它对我不起作用。
我做了什么:
strTitle1 = "Process Capability of " || Eval( Eval Expr( Expr( limits[1] ) ) ) || " - " ||
station || " - " || Eval( Eval Expr( Expr( limits[7] ) ) );
strCol = Eval( Eval Expr( Expr( limits[1] ) ) );
dt1 << New Script(
strTitle1,
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( Column( strCol ) ),
Quantiles( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Show Counts( 1 ),
Process Capability(
Use Column Property Specs,
Process Capability Analysis(
Overall Sigma Capability( 0 ),
Histogram( 1, Show Overall Sigma Density( 0 ) )
)
)
)
)
);
我最终得到的是:
min_detection_probability 的处理能力 - XX - XX
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( Column( strCol ) ),
Quantiles( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Show Counts( 1 ),
Process Capability(
Use Column Property Specs,
Process Capability Analysis(
Overall Sigma Capability( 0 ),
Histogram( 1, Show Overall Sigma Density( 0 ) )
)
)
)
)
谁能告诉我我哪里错了?
回复:使用变量作为列名谢谢你,成功了!回复:使用变量作为列名有一个名为 Column() 的函数,并且分发平台中还有一个名为 Column() 的元素。当您使用 TestName 作为参考时,JMP 会解释
Column( TestName )
作为 Column() 函数,因此不存在 Column 元素。将语法更改为
TestName = "VF (19)";
lub << append( Panel Box( "Distribution", db_Data << Distribution( Continuous Distribution( column( column( TestName ))) ) ) );
它会起作用的