안녕,
2개의 열이 있는 테이블에서 주별로 새 항목만 누적 표시되는 그래프를 만들고 싶습니다(예시로 첨부 참조). 표에는 2024년 1월 2일부터 2024년 9월 29일까지의 날짜에 연결된 91가지 종류의 과일이 있습니다. 아래는 원하는 그래프입니다. 지금까지 그래프를 얻기 위해 취한 단계는 너무 효과적/효율적이지 않은 것 같습니다. 누구든지 더 효과적인 (JSL) 방법이 있는지 궁금합니다.
그래프를 생성하는 데 사용한 단계:
1) Formula(Week Of Year(:Date))를 사용하여 동일한 테이블에 열을 생성합니다.
2) 테이블 N(Fruit)을 과일과 WW로 요약
3) 2)의 요약표에 수식(Col Min(:WW, :Fruit))이 포함된 열(Count of WW)을 추가합니다.
4) 과일별 요약표 Mean(Count of WW)
5) 요약표 N(Mean(Count of WW)) by Mean(Count of WW). 그런 다음 값이 0인 행을 누락된 WW에 수동으로 추가합니다. 그 주에는 새로운 과일이 없기 때문입니다. 이것은 통계 = 누적을 사용하여 그래프를 작성하는 데 사용한 테이블입니다.

귀하의 차트에 대한 JSL을 생성하기 위해 내가 한 것은 명시된 단계를 단계별로 수행하고 JMP가 생성한 로그에서 JSL을 복사하는 것이었습니다.나는 새로운 과일이 전혀 없는 근무 주에 0을 추가하는 문제를 해결하기 위해 약간의 원본 코드를 추가했지만 그 외에는 내가 아닌 JMP가 JSL을 만들었습니다.

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