日期:日期类型,建模类型和格式 - >如何修复MMM / YYYY格式为MMM / YYYY(001/2019 / 002/2019,... 012/2019)的数据作为日期类型导入字符 ,建模类型公称 。
我试图让JMP认识到这是一个约会。 最终格式本身不是导入的。 我在下面展示一种格式作为例子。
我试过脚本两种方法来解决没有运气的问题。列名是“MMM / YYYY”
[失败#1]
names default to here(1);
dt = current data table();
dt<< column(:"MMM/YYYY",Numeric,Continous,Format( "m/d/y", 10));
[失败#2]
names default to here(1);
dt = current data table();
:"MMM/YYYY"() << Date Type(Numeric) << Modeling Type(Continous) <<FORMAT></FORMAT>
Re:日期:日期类型,建模类型和格式 - >如何修复MMM / YYYY下面的脚本演示了一个简单的 INFORMAT() 会工作,或者你可以剥离领先的零和使用信息()。
New Column( "Date",
Numeric,
"Continuous",
Format( "m/y", 12 ),
Formula( Informat( Right( :Name("MMM/YYYY"), 8 ), "m/y" ) )
);
New Column( "Date2",
Numeric,
"Continuous",
Format( "m/y", 12 ),
Formula( Informat( :Name("MMM/YYYY") , "m/y" ) )
);
Re:日期:日期类型,建模类型和格式 - >如何修复MMM / YYYY这段代码有效,但似乎应该有一种更简单的方法。
//Reformat MMM/YYYY (create new columns, create new Date, delete MMM/YYYY)
New Column( "Month",
Numeric,
"Nominal",
Format( "Best", 9 ),
Formula( Num( Substr( :Name( "MMM/YYYY" ), 2, 2 ) ) )
);
New Column( "Year",
Numeric,
"Nominal",
Format( "Best", 9 ),
Formula( Num( Substr( :Name( "MMM/YYYY" ), 5, 8 ) ) )
);
New Column( "Date",
Numeric,
"Continuous",
Format( "m/y", 12 ),
Input Format( "m/y" ),
Formula( Date MDY( :Month, 1, :Year ) )
);
//Moves new column to follow Product Line
:Date << Set Selected( 1 );
dt << Move Selected Column( after( "Product Line" ) );
:Date << Set Selected( 0 );
