combinar acciones / guionesHola,
Me gustaría hacer una tabla, convertir en tabla de datos y luego agregar métricas calculadas basadas en la tabla de datos. A continuación se muestra lo que tengo ahora (copiando guión de cada acción). No estoy seguro de cómo combinar la acción de la tabla de datos y la nueva métrica. Por favor ayuda, gracias de antemano!
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
);Re: combinar acciones / scriptsIntente resumir (). Además, puede agregar un parámetro "Invisible" a la plataforma Tabulate, para que nunca vea la pantalla real ...
Re: combinar acciones / scriptsPregunta rápida: ¿hay una función Groupby en JSL (como en python) para reemplazar la función tabular?
Re: combinar acciones / scripts¡Muchas gracias Jim!
Sí, esto es exactamente lo que necesito. Agregar métrica calculada en la parte superior de la nueva tabla de datos generada por tabular. ¡Muchas gracias!Re: combinar acciones / scriptsVea mis comentarios en mis cambios a su script a continuación
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
);