表形式の表と画像を PPT スライドにループする方法こんにちは、私は JMP ループで行き詰まり、苦労しています。 サブセット テーブルから作成された表形式のテーブルをループするにはどうすればよいですか? テーブルの数は変更される可能性があるため、ループを実行する必要があると考えました(ただし、苦労しています)。また、この画像をパワーポイントのスライドに追加する必要もあります。 ループされた変数名を取得してスライドに追加する方法がわかりません。
これは私のサンプル スクリプトですが、ループはありません。 出来ますか?
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
:Sex << Set Name( "Sex_Subset" );
dt << New Column( "Sex", Formula(:Sex_Subset));
dt1 = dt << Subset( By( :Sex_Subset ), All rows, Selected columns only( 0 ) );
//this is where to loop tabulated tables since column values used in subsetting dt may change number of values
//how to loop this according to data table name? is that possible?
dt_Tab = Tabulate(
Add Table(
Column Table( Grouping Columns( :Sex ), Analysis Columns( :height ) ),
Row Table( Grouping Columns( :name, :age ) )
)
);
tab = dt_Tab << get picture; //variable name needs to be looped? for ppt slides
//after getting the plot as image, how can I append those images that were loop to ppt slides?
//for male table
hbppt1 = H List Box(tab) << get picture;
ppt1 = Outline Box( "Male", hbppt1 );
ppt1 << savepresentation( pathppt, append, PNG );
//for female table
hbppt2 = H List Box(tab2) << get picture;
ppt2 = Outline Box( "Female", hbppt2 );
ppt2 << savepresentation( pathppt, append, PNG );
サブセットからのテーブル
自動化とスクリプト作成Re: 表形式の表と画像を PPT スライドにループする方法By で Subset を使用すると、ループできるテーブルのリストが取得されます。
dt1 = {DataTable("Sex_Subset=F"), DataTable("Sex_Subset=M")};
編集:
使用している関数とメッセージのスクリプト インデックスを確認してください。一部が間違っています。
Names Default To Here(1);
pathppt = "$TEMP/bigclass.pptx";
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "Sex") << Set Name("Sex_Subset");
dt << New Column("Sex", Formula(:Sex_Subset));
dt_subsets = dt << Subset(By(:Sex_Subset), All rows, Selected columns only(0));
For Each({dt_subset}, dt_subsets,
subset_tab = dt_subset << Tabulate(
Add Table(
Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
Row Table(Grouping Columns(:name, :age))
)
);
tab_pic = subset_tab << get picture;
subset_tab << Close Window;
name_dt = dt_subset << get name;
Close(, no save);
hbppt = H List Box(tab_pic) << get picture;
ppt = Outline Box(name_dt, hbppt);
If(!File Exists(pathppt),
ppt << savepresentation(pathppt);
, // append only if file already exists
ppt << savepresentation(pathppt, append);
);
);
Open(pathppt);Re: 表形式の表と画像を PPT スライドにループする方法これは、スライドを作成するスクリプトを再加工したものです

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Specify the path to save the pptx's to
pathPPT = "$TEMP/UserID16644Slides.pptx";
:Sex << Set Name( "Sex_Subset" );
dt << New Column( "Sex", Formula( :Sex_Subset ) );
// Add value labels so the full value can be used for the slide title
dt:Sex_Subset << Value Labels( {"F" = "Female", "M" = "Male"} ) << Use Value Labels( 1 );
// Subset the tables. The dataTableList will contain a reference to each table created
dataTableList = dt << Subset( By( :Sex_Subset ), All rows, Selected columns only( 0 ) );
// Loop across all of the tables and create the Tabulates
For Each( {table, i}, dataTableList,
dt_Tab = table << Tabulate(
Add Table(
Column Table( Grouping Columns( :Sex ), Analysis Columns( :height ) ),
Row Table( Grouping Columns( :name, :age ) )
)
);
// Pull the subset name from the data table name
theTitle = Word( 3, Char( dataTableList[i] ), "\!"=" );
// Create the new slide
hbppt1 = H List Box( dt_tab << get picture);
ppt1 = Outline Box( theTitle, hbppt1 );
// The pptx must exist for the append to be used, so on the first
// slide it is not appended
if(i==1,
ppt1 << savepresentation( pathppt,"PNG" ),
ppt1 << savepresentation( pathppt, Append,"PNG" )
);
);
// Open the powerpoint presentation to see the results
open(pathppt);
Re: 表形式の表と画像を PPT スライドにループする方法JMP 16 をまだ持っていないので、For Each ループを For ループに変換しようとしましたが、出力が得られません
For (i = 1, i <= dataTableList, i++,
dt_Tab = table << Tabulate(
Add Table(
Column Table( Grouping Columns( :Sex ), Analysis Columns( :height ) ),
Row Table( Grouping Columns( :name, :age ) )
)
);
);
Re: 表形式の表と画像を PPT スライドにループする方法こんにちは、For Each ループを For に変換しようとしましたが、出力が得られません
For (i = 1, i <= dt_subsets, i++,
subset_tab = dt_subset << Tabulate(
Add Table(
Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
Row Table(Grouping Columns(:name, :age))
)
);
);
Re: 表形式の表と画像を PPT スライドにループする方法dt_subsets は JMP リストです。必要なのはリスト内の要素の数です。
For (i = 1, i <= N Items( dt_subsets ), i++,
subset_tab = dt_subset << Tabulate(
Add Table(
Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
Row Table(Grouping Columns(:name, :age))
)
);
);
Re: 表形式の表と画像を PPT スライドにループする方法なるほど。 また、dt_subset がどこから来たのか疑問に思っています。

このコード行を試してみたところ、 dt_subset ( dt_subset << Tabulate() )見つかりません。 ただし、これを dt_subsets に置き換えてみました。テーブルが 2 つ表化されました (男性用に 2 つ、女性用に 2 つの表が作成されました)。
For (i = 1, i <= N Items( dt_subsets ), i++,
subset_tab = dt_subset << Tabulate(
Add Table(
Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
Row Table(Grouping Columns(:name, :age))
)
);
);
Re: 表形式の表と画像を PPT スライドにループする方法そうである必要があります
For (i = 1, i <= N Items( dataTableList ), i++,
Re: 表形式の表と画像を PPT スライドにループする方法変数
dt_subset
はエラーです、そうする必要があります
dt_subsets