combinare azioni / scriptCiao,
Mi piacerebbe fare un tabulato, creare una tabella di dati e quindi aggiungere la metrica calcolata in base alla tabella di dati. Di seguito è quello che ho ora (copiando script di ogni azione). Non sono sicuro di come combinare l'azione della tabella dei dati e la nuova metrica. Per favore aiuto, grazie in anticipo!
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
);Ri: combinare azioni / scriptProva a riassumere (). Inoltre, puoi aggiungere un parametro "Invisibile" alla piattaforma Tabulate, in modo da non vedere mai la visualizzazione effettiva ....
Ri: combinare azioni / scriptDomanda veloce: esiste una funzione Groupby in JSL (come in python) per sostituire la funzione tabulate?
Ri: combinare azioni / scriptGrazie mille Jim!
Sì, questo è esattamente ciò di cui ho bisogno. Aggiunta della metrica calcolata sulla parte superiore della nuova tabella di dati generata da tabulate. Molte grazie!Ri: combinare azioni / scriptVedi i miei commenti nelle mie modifiche al tuo script qui sotto
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
);