Hi,
Ich möchte ein Diagramm erstellen, das kumulativ nur neue Artikel pro Woche aus einer Tabelle mit 2 Spalten anzeigt (siehe Anhang als Beispiel). In der Tabelle gibt es 91 verschiedene Obstsorten, die mit dem Datum vom 02.01.2024 bis 29.09.2024 verknüpft sind. Unten ist das gewünschte Diagramm. Die Schritte, die ich bisher unternommen habe, um das Diagramm zu erhalten, scheinen nicht allzu effektiv/effizient zu sein. Ich frage mich, ob jemand einen effektiveren (JSL) Weg hat, dies zu tun?
Schritte, mit denen ich das Diagramm erstellt habe:
1) Erstellen Sie eine Spalte in derselben Tabelle mit Formel (Woche des Jahres (: Datum)).
2) Tabelle N(Obst) nach Obst und WW zusammenfassen
3) Fügen Sie in der Übersichtstabelle von 2) eine Spalte (Count of WW) mit Formula(Col Min(:WW, :Fruit)) hinzu.
4) Übersichtstabelle Mittelwert (Zählung der WW) nach Obst
5) Übersichtstabelle N(Mittelwert(Anzahl der WW)) durch Mittelwert(Anzahl der WW). Ich füge dann manuell Zeilen mit dem Wert = 0 zu jedem fehlenden WW hinzu, da diese Woche keine neuen Früchte enthält. Dies ist die Tabelle, die ich dann verwendet habe, um das Diagramm mit Statistik = kumulativ zu erstellen.

Alles, was ich getan habe, um die JSL für Ihr Diagramm zu erstellen, war, die angegebenen Schritte durchzugehen und die JSL aus dem von JMP erstellten Protokoll zu kopieren.Ich habe ein wenig Originalcode hinzugefügt, um das Hinzufügen von Nullen für alle Arbeitswochen zu lösen, in denen es keine neuen Früchte gibt, aber ansonsten hat JMP die JSL erstellt, nicht ich

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" )
)
)
)