cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
JMP 함수를 활용한 Week Number 산출

주차(Week Number)를 만들기 위해서 아래와 같은  가상의 Data Table을 만든다.

New Table( "JMP Blog",
	Add Rows( 1097 ),
	New Column( "Date",
		Numeric,
		"Continuous",
		Format( "yyyy-mm-dd", 12 ),
		Input Format( "yyyy-mm-dd" ),
		Set Selected
	)
)

week number1.png

위와 같이 생성된 Data Table에서 다음과 같은 몇번의 함수작업을 통해 최종적인 주차(Week Number)를 구할 수 있다.

col= New Column("Month Abb", character, Formula(Substr( Format( :Date, "Monddyyyy" ), 1, 3 )));
col= New column("Week Num", character, Formula(Floor( (Day( :Date ) - Day Of Week( :Date ) - 1) / 7 + 2 )));
col= New Column("temp",formula(num(:Week Num)));
column(dt, "temp") << delete formula;
column(dt, "temp") << Data Type ( Character);
col= New Column("Weeks",character,<< set each value("W"));
col= New Column("Week Number", character, formula(:Month Abb || "-" || :temp || :Weeks));

최종 데이터 테이블은 다음과 같이 주어진다.

Week Number.png

완성된 JMP Data Table과 Sample Script를 첨부합니다.

Last Modified: Oct 20, 2019 8:33 PM