やあ、
2 つの列を持つテーブルから週ごとに新しいアイテムのみの累積を表示するグラフを作成したいと考えています (例として添付を参照)。 表には、2024 年 1 月 2 日から 2024 年 9 月 29 日までの日付にリンクする 91 種類の果物があります。 以下は目的のグラフです。 グラフを取得するためにこれまでに行った手順は、あまり効果的/効率的ではないようです。 誰かがそれを行うためのより効果的な(JSL)方法を持っているのだろうか?
グラフを生成するために使用した手順:
1) Formula(Week Of Year(:Date)) を使用して同じテーブルに列を作成します。
2) テーブル N(フルーツ) をフルーツと WW で要約する
3) 2) の集計表に、式 (Col Min(:WW, :Fruit)) を含む列 (WW の数) を追加します。
4) 要約表 果物別の平均値(WW の数)
5) 要約テーブル N (Mean(Count of WW)) by Mean(Count of WW)。 次に、欠落している WW に値 = 0 の行を手動で追加します。これらの週には新しい果物がないためです。 これは、統計 = 累積を使用してグラフを作成するために使用した表です。

あなたのチャートのJSLを作成するために私がしたことは、あなたが述べた手順を踏んで、JMPが生成したログからJSLをコピーすることだけでした。新しい成果がまったくない勤務週にゼロを追加する問題を解決するために、少しオリジナルのコードを追加しましたが、それ以外は、私ではなく JMP が JSL を作成しました。

names default to here(1);
dt=data table("Fruit by date");
// New column: Column 3
Data Table( "Fruit by date" ) << New Column( "WW",
Numeric,
"ordinal",
Format( "Best", 12 ),
formula(week of year(:date))
);
// Data table summary
// → Data Table( "Fruit by date (1) By (Fruit, WW)" )
Data Table( "Fruit by date" ) << Summary(
Group( :Fruit, :WW ),
N( :Fruit ),
Freq( "None" ),
Weight( "None" )
);
// Change column formula: Count of WW
Data Table( "Fruit by date By (Fruit, WW)")<<
New column("Count of WW", Formula( Col Minimum( :WW, :Fruit ) ));
// Data table summary
// → Data Table( "Fruit by date By (Fruit, WW) By (Fruit)" )
Data Table( "Fruit by date By (Fruit, WW)" ) <<
Summary( Group( :Fruit ), Mean( :Count of WW ), Freq( "None" ), Weight( "None" ) );
// Data table summary
// → Data Table( "Fruit by date By (Fruit, WW) By (Fruit) By (Mean(Count of WW))" )
Data Table( "Fruit by date By (Fruit, WW) By (Fruit)" ) <<
Summary(
Group( :"Mean(Count of WW)"n ),
N( :"Mean(Count of WW)"n ),
Freq( "None" ),
Weight( "None" )
);
// Data table summary
// → Data Table( "Fruit by date By (WW)" )
Data Table( "Fruit by date" ) << Summary(
Group( :WW ),
Freq( "None" ),
Weight( "None" ),
link to original data table(0)
);
for each row(
:N Rows = 0;
);
:WW << set name("Mean(Count of WW)");
// Update data tables
Data Table( "Fruit by date By (WW)" ) << Update(
With( Data Table( "Fruit by date By (Fruit, WW) By (Fruit) By (Mean(Count of WW))" ) ),
Match Columns( :"Mean(Count of WW)"n = :"Mean(Count of WW)"n )
);
data table("Fruit by date by (WW)") << Graph Builder(
Size( 891, 456 ),
Show Control Panel( 0 ),
Variables( X( :"Mean(Count of WW)"n ), Y( :N Rows ) ),
Elements(
Bar(
X,
Y,
Legend( 5 ),
Summary Statistic( "Cumulative Sum" ),
Label( "Label by Value" )
)
)
)