Aktionen/Skripte kombinierenHallo,
Ich möchte eine Tabelle erstellen, sie in eine Datentabelle umwandeln und dann eine berechnete Metrik basierend auf der Datentabelle hinzufügen. Unten ist, was ich jetzt habe (Skript jeder Aktion kopieren). Ich bin nicht sicher, wie ich die Aktion der Datentabelle und der neuen Metrik kombinieren soll. Bitte helfen Sie, vielen Dank im Voraus!
dt = Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table(
Analysis Columns(
:Name( "201733 Weekly COMP Store Sales" ),
:Name( "201833 Weekly COMP Store Sales" )
)
),
Row Table(
Grouping Columns( :Name( "18 IRI Market" ) ),
Add Aggregate Statistics( :Name( "18 IRI Market" ) )
)
)
);
dt << makeintodatatable;
dt << New Column( "ratio",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( :Name( "Sum(201833 Weekly COMP Store Sales)" ) / :Name( "Sum(201733 Weekly COMP Store Sales)" ) ),
Set Selected
);Betreff: Aktionen/Skripte kombinierenVersuchen Sie es mit Summarize().Außerdem können Sie der Tabulate-Plattform einen „Unsichtbar“-Parameter hinzufügen, sodass Sie nie die tatsächliche Anzeige sehen....
Betreff: Aktionen/Skripte kombinierenKurze Frage: Gibt es in JSL eine Groupby-Funktion (wie in Python), die die Tabulatorfunktion ersetzt?
Betreff: Aktionen/Skripte kombinierenVielen Dank, Jim!
Ja, das ist genau das, was ich brauche. Hinzufügen einer berechneten Metrik zusätzlich zur neuen Datentabelle, die durch Tabulate generiert wurde. Vielen Dank!Betreff: Aktionen/Skripte kombinierenSiehe meine Kommentare zu meinen Änderungen an Ihrem Skript unten
dt = current data table();
// dt normally is a reference to a data table, as I have referenced
// in the statement above. The variable "tab", below, will refer to the
// tabulate platform
tab = dt << Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table(
Analysis Columns(
:Name( "201733 Weekly COMP Store Sales" ),
:Name( "201833 Weekly COMP Store Sales" )
)
),
Row Table(
Grouping Columns( :Name( "18 IRI Market" ) ),
Add Aggregate Statistics( :Name( "18 IRI Market" ) )
)
)
);
// the dt2 variable will point to the new output data table
dt2 = tab << makeintodatatable;
// I am a little confused as to what data table you really want to
// add the new column to......I am changing the dt data tablereference
// to dt2, it is in the output data table that thes columns exist
dt2 << New Column( "ratio",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
:Name( "Sum(201833 Weekly COMP Store Sales)" ) /
:Name( "Sum(201733 Weekly COMP Store Sales)" )
),
Set Selected
);