回复:脚本问题 - 包含数月数据的数据集。想要使用脚本创建主数据表的子集以及“选定”月份的数据我对你需要什么感到困惑。 但是,我认为下面的代码可能会有所帮助,如果不是你想要的,那么至少可以进行对话
// Your Month column is a JMP Date/Time column. It is numeric, based upon
// the number of seconds since Jan. 1, 1904. Therefore, your MONTH variable
// needs to have the number of seconds set. The easiest way to do this is
// to use the Informat() function.
MONTH = Informat( "05/2019", "m/y" );
// If you show the MONTH variable using a Fixed Decimal format, it will show
// the numeric value
Show( Format( MONTH, "Fixed Dec", 12 ) );
// Concerning the Select Where, I think what you really want to do, is to
// determine the Month for each of rows and then select those rows where
// column Month is the 5th month. That code would be
CT_5 << Select Where( Month( :Month ) == 5 );
回复:脚本问题 - 包含数月数据的数据集。想要使用脚本创建主数据表的子集以及“选定”月份的数据这很可能是因为范围层次结构。我猜你的专栏也被称为“月”?
如果您明确说明它
::month = "05/2019"
// or
here:month = "05/2019"
//or just change the name
month_str = "05/2019"
我认为它应该有效。
回复:脚本问题 - 包含数月数据的数据集。想要使用脚本创建主数据表的子集以及“选定”月份的数据我还在努力解决这个问题。我的数据集有“工作日期”,例如01/01/2019至,每年至今。它还有一个“月”列,它是数字序数(01/2019/02/2019 / 03/2019等)员工工作日WW月总数小时J. Doe 01/01/2019 1 01/2019 5 J. Doe 01/04/2019 1 01/2019 3 J. Doe 02/05/2019 6 02/2019 4 J Doe 02/06/2019 6 02/2019 2 ETC,ETC对于数据集我正试图剔除“月”= 05/2019。所以建议我设置一个变量::: MONTH =“05/2019”;然后在JSL中我尝试使用tha来剔除数据集,但我无法让它工作。MyList = {:: MONTH}; CT_5 <<选择Where((包含(MyList,:Month))); CT_5 <<反转行选择; CT_5 <<删除行(); ???
回复:脚本问题 - 包含数月数据的数据集。想要使用脚本创建主数据表的子集以及“选定”月份的数据如果我理解你想要做什么,我建议:
CT_5 << select where( month(:Workdate) == 5 and year(:Workdate) == 2019 );
回复:脚本问题 - 包含数月数据的数据集。想要使用脚本创建主数据表的子集以及“选定”月份的数据您可以使用And()函数或运算符(&),但不能使用一个字面代替另一个。所以要么使用这种形式:
CT_5 << select where( month(:Workdate) == 5 & year(:Workdate) == 2019 );
或使用此表格:
CT_5 << select where( And( month(:Workdate) == 5, year(:Workdate) == 2019 ) );
脚本问题 - 包含数月数据的数据集。想要使用脚本创建主数据表的子集以及“选定”月份的数据有人可以帮我解决这个问题吗?我认为问题与“月”的输入/格式不正确有关。
我有一个数据集,其中一列是“月”。 “Month”具有以下列属性:
*数字
*序数
*格式化m / y
*输入格式m / y
在“05/2019”的情况下,我正试图在脚本中为任何给定月份建立一个变量
MONTH = “05/2019” ;
错误信息:
MONTH =“05/2019”;
/ *:
列“月”在访问或评估“错误参数”时需要数值{109}
稍后在脚本中我试图使用我在上面的脚本中尝试建立的变量来剔除特定月份的数据:
MyList = {"MONTH"};
CT_5<< Select Where( (Contains(MyList, :Month)))
CT_5 << Invert Row Selection;
CT_5 << Delete Rows();
错误信息:
在访问或评估“发送”时发送预期脚本对象{109},CT_5 << / * ### * /选择Where(包含(MyList,:Month))/ * ### * /
在以下脚本中,错误标记为/ * ### * /
MyList = {MONTH};
CT_5 << / * ### * /选择Where(包含(MyList,:Month))/ * ### * /;
CT_5 <<反转行选择;
CT_5 <<删除行();
回复:脚本问题 - 包含数月数据的数据集。想要使用脚本创建主数据表的子集以及“选定”月份的数据谢谢你的建议。 这对我来说很有意义,但是当我尝试运行脚本时:
CT_5 << select where( month(:Workdate) == 5 and year(:Workdate) == 2019 );
我收到一条“JMP警报”,其中说明:
“意外”和“年”。 也许缺少“,”或“)”。 “
我尝试了各种变化添加“(”等。但无法让JSL运行。
回复:脚本问题 - 包含数月数据的数据集。想要使用脚本创建主数据表的子集以及“选定”月份的数据通过反复试验,我按照你的建议让JSL运行:
CT_5 << select where( month(:Workdate) == 05 & year(:Workdate) == 2019 );
现在我正在尝试在JSL脚本的开头设置一个变量“SELECTED MONTH”,我会手动更新(在这种情况下):
SELECTED MONTH = month(:Workdate) == 05 & year(:Workdate) == 2019;
注意:我认为这个脚本有问题,因为它没有提供我期望的输出。 当我运行脚本时:
Show (SELECTED MONTH);
我得到“=:”而不是: 月 (:工作日)== 05 & 年 (:工作日)== 2019
然后在下面的JSL中我想运行脚本:
CT_5 << select where( SELECTED MONTH );
意图是它相当于:
CT_5 << select where( month(:Workdate) == 05 & year(:Workdate) == 2019 );
有什么建议吗?