日付:日付の種類、モデルの種類とフォーマット - > MMM / YYYYの修正方法MMM / YYYY(001/2019、002/2019、... 012/2019)形式のデータが日付タイプとしてインポートされていますキャラクターモデリングタイプ公称 。
私はJMPにこれを日付として認識させようとしています。 最終フォーマットはそれ自体インポートではありません。 一例として、フォーマットを以下に示します。
私は幸運なことに修正するために2つの方法をスクリプトで試してみました。列名は "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>
日時:日付の種類、モデルの種類とフォーマット - > MMM / YYYYの修正方法以下のスクリプトは、単純な Informat() うまくいくか、先行ゼロを取り除いて使うことができます 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" ) )
);
日時:日付の種類、モデルの種類とフォーマット - > 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 );
