Datafilter 구문 분석에서 추출된 열 참조다른 용도로 데이터 필터 인터페이스를 사용하고 싶습니다.
그런 다음 "select where" 절을 구문 분석하고 거기에 있는 정보를 사용해야 합니다.
Where 절을 구문 분석하고 식에서 다른 열을 식별할 수 있습니다.
그러나 그들을 참조하지
DFClause=Currentdatafilter << get where clause();<BR />SelectInnerExpr=Arg(parse(DFClause),1);<BR />// let assume for a second this will always return an expression of this type to simplify the example <BR />SelectInnerExpr= expr(:study_owner == "name" & :Is Electr. == 1);<BR /><BR />//so i can parse it with a simple for loop
for(iA=1,iA<=NArg(SelectInnerExpr),iA++,
TestColExp=Arg(Arg(SelectInnerExpr,iA),1); // here i can get the column as i need but as :ColumName
TestCol=eval(TestColExp); // so this does not really retun the column reference<BR /> colname= TestCol<< Get Name;
);
그러나 나는 열을 :ColumName으로 얻습니다.
이제 열 참조를 얻은 다음 스크립트를 계속하려면 어떻게 해야 합니까?
열 이름= TestCol << 이름 가져오기
윈도우Re: Datafilter 구문 분석에서 추출한 열 참조이것이 당신이 찾고 있는 것입니까? For() 루프를 수정하여 첫 번째 비트를 char에 넣은 다음 첫 번째 단어를 꺼내서 구문 분석했습니다. 전체 스크립트 첨부. 또한 다른 사람들이 추가할 수 있는 보다 우아한 방법이 있을 수 있습니다.
For( iA = 1, iA <= N Arg( SelectInnerExpr ), iA++,
TestColExp = Char( Arg( Arg( SelectInnerExpr, iA ), 1 ) ); // put all into a char()
TestCol = Parse( Word( 1, TestColExp ) ); //now returns test col
);
Re: Datafilter select where에서 파싱한 열 참조이것도 작동하는 듯하지만, 열 이름에 열린 괄호가 있는 그렇게 흔치 않은 경우에는 실패합니다. 문제가 된다면 그걸 위해 트랩을 해야 할 겁니다.
Names Default To Here( 1 );
dt = open("$Sample_Data\Car Physical Data.jmp");
gb = dt << Graph Builder(
Size( 526, 668 ),
Show Control Panel( 0 ),
Variables( X( :Turning Circle ), Y( :Horsepower ) ),
Elements( Points( X, Y, Legend( 5 ) ), Smoother( X, Y, Legend( 6 ) ) ),
Local Data Filter(
Show Histograms and Bars( 0 ),
Add Filter( columns( :Country, :Type ), Display( :Type, N Items( 5 ) ) ),
Add Filter( columns( :Weight ), Display( :Weight, Height( 20 ) ) )
)
);
<BR /><BR /><BR /><BR />//////////// processing here
ob = (report(gb) << parent)[outlinebox(1)];
lis = (ob << xpath( "//TabPageBox" )) << get title;
colnames = Transform Each( {v, i}, lis[2 :: (N Items( lis ) - 1)],
Trim Whitespace( Items( [1 1], v, "(" )[1] )
);