Re:循环错误以使数值列标准化指定公式值时,它不会对公式的JSL进行任何评估。 相反,它只是将代码移动到公式中。 那么,公式中的内容是“ Col标准化 ( : numericColNames [ 一世 ] ) “不是,” Col标准化 ( : YourColumnName )”。 因此,当执行公式时,它将查找“i”的值,当它执行时,它已经移动了beyone你的Colnames的下标范围。 因此,需要做的是将公式的精确JSL语法放入公式中。
Names Default To Here( 1 );
dt = Current Data Table();
numericColNames = dt << get column names( string, numeric );
For( i = 1, i <= N Items( numericColNames ), i++,
Eval(
Substitute(
Expr(
New Column( Char( numericColNames[i] ) || "_Stand",
Numeric,
Continuous,
Formula( Col Standardize( __col__ ) )
)
),
Expr( __col__ ), Parse( ":" || numericColNames[i] )
)
)
);循环错误标准化数字列你好。我编写了一个脚本来创建从公式到标准化的新数值列,但在评估公式时我得到一个错误。我做错了什么?
谢谢。
剧本:
Names Default To Here( 1 );
dt = Current Data Table();
numericColNames = dt << get column names( string, numeric );
For( i = 1, i <= N Items( numericColNames ), i++,
New Column( Char( numericColNames[i] ) || "_Stand",
Numeric,
Continuous,
Formula( Col Standardize( :numericColNames[i] ) ) )
);
错误:
Name Unresolved: numericColNames 1 times At rows: {1} Operation: numericColNames, :numericColNames
Re:循环错误以使数值列标准化亲爱的先生,我有一张小桌子可以试试。它由一个列为城市名称的列组成(1900),其整数值对应于1900年的总体,另一列以百分比表示。 当我尝试scritp时,我发现,虽然指令“numericColNames = DT << 获取列名称 ( 串 ,数字 ) ; “在创建两个新列时,将col 1900和”Percentage Canvi“识别为数字,对应于1900的列使其具有缺失值。
Re:循环错误以使数值列标准化像1900这样的列名可能会混淆JMP,因为它可能不知道它是否应该将其视为数字或列名。 因此,需要通过使用:Name()函数明确指出它是列名...请参阅下面的重写脚本
Names Default To Here( 1 );
dt = Current Data Table();
numericColNames = dt << get column names( string, numeric );
numericColNames = {"1900"}
For( i = 1, i <= N Items( numericColNames ), i++,
Eval(
Substitute(
Expr(
New Column( Char( numericColNames[i] ) || "_Stand",
Numeric,
Continuous,
Formula( Col Standardize( __col__ ) )
)
),
Expr( __col__ ), Parse( ":Name(\!"" || numericColNames[i] || "\!")" )
)
)
);Re:循环错误以使数值列标准化先生,你似乎对一切都有答案。再次感谢您的贡献!