日期:日期類型,建模類型和格式 - >如何修復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 );
