if 문에 대한 도움말안녕,
나는 아마도 여기에 기본적인 것을 놓치고있을 것입니다. 다른 두 열 값의 조합을 사용하여 열 값을 변경하려고 합니다. 다음 if 문을 입력했는데 열 값이 변경되지 않습니다. 내가 여기서 무엇을 놓치고 있습니까? 모든 조언과 조언에 감사드립니다.
Names Default To Here( 1 );
dt = Data Table( "20210811Miflezet_CAPCMP.jmp" );
dt << Begin Data Update;
If( :justice_decision_REC_RILE2 == "reject" & :RILE_Calc2a == "center"
,
:Rile_Calc3 == "center"
,
:justice_decision_REC_RILE2 == "accept" & :RILE_Calc2a == "center"
,
:Rile_Calc3 == "center"
,
:justice_decision_REC_RILE2 == "reject" & :RILE_Calc2a == "left"
,
:Rile_Calc3 == "right"
,
:justice_decision_REC_RILE2 == "accept" & :RILE_Calc2a == "left"
,
:Rile_Calc3 == "left"
,
:justice_decision_REC_RILE2 == "reject" & :RILE_Calc2a == "right"
,
:Rile_Calc3 == "left"
,
:justice_decision_REC_RILE2 == "accept" & :RILE_Calc2a == "right"
,
:Rile_Calc3 == "right"
);
dt << End Data Update;
데이터 테이블스크립팅Re: if 문에 대한 도움말For Each Row 또는 Set Each Value를 사용할 수 있습니다. 다음은 예입니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
For Each Row(
If(:sex == "F",
:age = .
);
);
dt:weight << Set Each Value(
If(:sex == "M",
.,
:height
);
);Re: if 문에 대한 도움말답변 해주셔서 감사합니다! 다양한 스크립팅 가이드에서 알 수 있듯이 올바른 것이지만 여기에서는 작동하지 않았습니다. 데이터 테이블과 이 변수에 대해 이미 수행한 모든 처리에 문제가 있다고 가정합니다. 결국 해결 방법은 두 개의 명목 열을 하나로 연결한 다음 내가 얻은 표현식을 원하는 결과로 다시 코딩하는 것이었습니다. 다시 한번 감사합니다.
Re: if 문에 대한 도움말원래 JSL에서 아마도 ( 편집 : 또한 ) 변경하기를 원할 것입니다.
Rile_Calc3 == "center" // compare. the result of the compare (0 or 1) will be the result of the if(), see below
NS
Rile_Calc3 = "center" // assign value
JSL if 문이 값을 반환합니다. 당신은 그것을 쓸 수 있습니다
:Rile_Calc3 = If(
:justice_decision_REC_RILE2 == "reject" & :RILE_Calc2a == "center", "center",
:justice_decision_REC_RILE2 == "accept" & :RILE_Calc2a == "center", "center",
:justice_decision_REC_RILE2 == "reject" & :RILE_Calc2a == "left", "right",
:justice_decision_REC_RILE2 == "accept" & :RILE_Calc2a == "left", "left",
:justice_decision_REC_RILE2 == "reject" & :RILE_Calc2a == "right", "left",
:justice_decision_REC_RILE2 == "accept" & :RILE_Calc2a == "right", "right",
:Rile_Calc3 // or "Unknown" ? depends how you want to handle the unexpected case.
);
예상치 못한 경우가 없다는 것을 안다면 마지막 else 절을 생략할 수 있습니다. 그러나 예상치 못한 경우의 본질은 가장 예상하지 못한 때에 나타나는 것입니다.
비밀이라면