액션 / 스크립트 결합안녕하세요,
표를 만들고 데이터 표를 만든 다음 데이터 표를 기반으로 계산 된 통계를 추가하고 싶습니다. 아래는 내가 지금 가지고있는 것입니다 (각 액션 스크립트 복사). 데이터 테이블의 작업과 새 메트릭을 결합하는 방법을 잘 모르겠습니다. 제발 도와주세요, 미리 감사드립니다!
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
);다시 : 작업 / 스크립트 결합Summarize ()를 시도하십시오. 또한, "보이지 않는"매개 변수를 도표 플랫폼에 추가하여 실제 화면을 보지 못할 수도 있습니다 ....
다시 : 작업 / 스크립트 결합빠른 질문 : 테이블 함수를 대체하기 위해 Python과 같은 JSL에 Groupby 함수가 있습니까?
다시 : 작업 / 스크립트 결합짐 정말 고마워!
예, 이것이 제가 필요한 것입니다. 표로 생성 된 새 데이터 테이블 위에 계산 된 메트릭 추가. 고마워요!다시 : 작업 / 스크립트 결합아래 스크립트 변경 내 의견보기
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
);