GraphBuilder 스크립트에 N을 추가하기 위해 여러 대체를 업데이트하는 방법: 스크립트 포함안녕하세요 팀,
자리 표시자 "_text0_"을 "_text5_"로 대체하여 GraphBuilder에 N을 추가하도록 아래 스크립트를 수정하고 싶습니다.
"_Yname_" 자리 표시자에 대한 단일 대체를 구현하는 방법을 알고 있지만 다중 대체를 파악하기 위해 정신적인 어려움을 겪고 있습니다.
또한 플롯의 각 오버레이에 대해 N을 동적으로 생성하기 위해 열 통계를 호출하는 방법을 모르겠습니다(스크립트 아래 그림 참조)
Names Default to Here (1);
dt = Current Data Table ();
Clist = dt << Get Column Names (String);
For (i = 932, i<= 935, i++,
gb = Expr ( Graph Builder(
Size( 789, 440 ),
Variables(
X( :Visit ),
Y( column (i) ),
Group X( :LEAD TAG ),
Overlay( :SHORT TAG )
),
Elements( Line( X, Y, Legend( 7 ), Error Bars( "Standard Error" ) ) ),
SendToReport(
Dispatch(
{},
_Yname_,
ScaleBox,
{Format( "Best", 12 ), Min( -1.8 ), Max( 1.0 ),
Inc( 0.2 ), Minor Ticks( 1 ),
Add Ref Line( 0, "Dotted", "Black", "", 2 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script(
2,
Description( "Script" ),
Text( Center Justified, {0.5, -1.6}, "_text0_" )
), Add Graphics Script(
3,
Description( "Script" ),
Text( Center Justified, {0.5, -1.75}, "_text1_" )
), Grid Line Order( 5 ), Reference Line Order( 6 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox( 2 ),
{Left( 1 ), Right( 0 ), Top( 0 ), Bottom( 1 ),
Add Graphics Script(
2,
Description( "Script" ),
Text( Center Justified, {0.5, -1.75}, "_text3_" )
), Add Graphics Script(
3,
Description( "Script" ),
Text( Center Justified, {0.5, -1.6}, "_text2_" )
), Grid Line Order( 5 ), Reference Line Order( 6 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox( 3 ),
{Left( 1 ), Right( 1 ), Top( 0 ), Bottom( 1 ),
Add Graphics Script(
2,
Description( "Script" ),
Text( Center Justified, {0.5, -1.6}, "_text4_" )
), Add Graphics Script(
3,
Description( "Script" ),
Text( Center Justified, {0.5, -1.75}, "_text5_" )
), Grid Line Order( 5 ), Reference Line Order( 6 )}
)
)
)
);
gbe = Eval (substitute(Name Expr (gb), Expr (_Yname_), Clist [i]));
gbe << journal;
gbe << close window;
);
Re: GraphBuilder 스크립트에 N을 추가하기 위해 여러 대체를 업데이트하는 방법: 스크립트 포함안녕하세요 txnelson님
당신의 도움을 주셔서 대단히 감사합니다. 예상대로 스크립트는 99%였습니다. 아래와 같이 기본 테이블(dt)에 몇 가지 호출을 추가해야 했습니다.
For (i = 932, i<= 1115, i++,
try( close( dtSum, nosave ) );
dtSum = <FONT color="#FF0000">dt</FONT> << Summary(invisible,
Group( :LEAD TAG, :SHORT TAG ),
N( as column( Clist[i] ) ),
Freq( "None" ),
Weight( "None" ),
statistics column name format( "column" )
);
gb = Expr ( <FONT color="#FF0000">dt</FONT> << Graph Builder(
Size( 789, 440 ),
Variables(
X( :Visit ),
Y( column (i) ),
Group X( :LEAD TAG ),
Overlay( :SHORT TAG )
),
Elements( Line( X, Y, Legend( 7 ), Error Bars( "Standard Error" ) ) ),
SendToReport(
Dispatch(
{},
_Yname_,
ScaleBox,
{Format( "Best", 12 ), Min( -1.8 ), Max( 1.0 ),
Inc( 0.2 ), Minor Ticks( 1 ),
Add Ref Line( 0, "Dotted", "Black", "", 2 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script(
2,
Description( "Script" ),
Text( Center Justified, {0.5, -1.6}, _text0_ )
), Add Graphics Script(
3,
Description( "Script" ),
Text( Center Justified, {0.5, -1.75}, _text1_ )
), Grid Line Order( 5 ), Reference Line Order( 6 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox( 2 ),
{Left( 1 ), Right( 0 ), Top( 0 ), Bottom( 1 ),
Add Graphics Script(
2,
Description( "Script" ),
Text( Center Justified, {0.5, -1.75}, _text3_ )
), Add Graphics Script(
3,
Description( "Script" ),
Text( Center Justified, {0.5, -1.6}, _text2_ )
), Grid Line Order( 5 ), Reference Line Order( 6 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox( 3 ),
{Left( 1 ), Right( 1 ), Top( 0 ), Bottom( 1 ),
Add Graphics Script(
2,
Description( "Script" ),
Text( Center Justified, {0.5, -1.6}, _text4_ )
), Add Graphics Script(
3,
Description( "Script" ),
Text( Center Justified, {0.5, -1.75}, _text5_ )
), Grid Line Order( 5 ), Reference Line Order( 6 )}
)
)
)
);
gbe = Eval (substitute(Name Expr (gb), Expr (_Yname_), Clist [i],
Expr ( _text0_ ), char( column( dtSum, Clist[i] )[1] ),
Expr ( _text1_ ), char( column( dtSum, Clist[i] )[2] ),
Expr ( _text2_ ), char( column( dtSum, Clist[i] )[3] ),
Expr ( _text3_ ), char( column( dtSum, Clist[i] )[4] ),
Expr ( _text4_ ), char( column( dtSum, Clist[i] )[5] ),
Expr ( _text5_ ), char( column( dtSum, Clist[i] )[6] )
));
gbe << journal;
gbe << close window;
);Re: GraphBuilder 스크립트에 N을 추가하기 위해 여러 대체를 업데이트하는 방법: 스크립트 포함Substitute() 함수의 단일 호출로 여러 대체를 수행할 수 있습니다.
gbe = Eval(
Substitute( Name Expr( gb ),
Expr( _Yname_ ), Clist[i],
Expr( "_text0_"), "actual text",
...
)
);
Re: GraphBuilder 스크립트에 N을 추가하기 위해 여러 대체를 업데이트하는 방법: 스크립트 포함이를 수행하는 한 가지 방법이 있습니다.샘플 데이터 테이블이 없기 때문에 테스트되지 않은 코드이기 때문에 코드가 첫 번째 시도에서 작동할 것이라고 보장할 수 없습니다.그러나 꽤 가까워야 합니다.
Names Default to Here (1);
dt = Current Data Table ();
Clist = dt << Get Column Names (String);
For (i = 932, i<= 935, i++,
try( close( dtsum, nosave ) );
dtSum = << Summary(invisible,
Group( :LEAD TAG, :SHORT TAG ),
N( as column( Clist[i] ) ),
Freq( "None" ),
Weight( "None" ),
statistics column name format( "column" ),
Link to original data table( 0 )
);
gb = Expr ( dt << Graph Builder(
Size( 789, 440 ),
Variables(
X( :Visit ),
Y( column (i) ),
Group X( :LEAD TAG ),
Overlay( :SHORT TAG )
),
Elements( Line( X, Y, Legend( 7 ), Error Bars( "Standard Error" ) ) ),
SendToReport(
Dispatch(
{},
_Yname_,
ScaleBox,
{Format( "Best", 12 ), Min( -1.8 ), Max( 1.0 ),
Inc( 0.2 ), Minor Ticks( 1 ),
Add Ref Line( 0, "Dotted", "Black", "", 2 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script(
2,
Description( "Script" ),
Text( Center Justified, {0.5, -1.6}, _text0_ )
), Add Graphics Script(
3,
Description( "Script" ),
Text( Center Justified, {0.5, -1.75}, _text1_ )
), Grid Line Order( 5 ), Reference Line Order( 6 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox( 2 ),
{Left( 1 ), Right( 0 ), Top( 0 ), Bottom( 1 ),
Add Graphics Script(
2,
Description( "Script" ),
Text( Center Justified, {0.5, -1.75}, _text3_ )
), Add Graphics Script(
3,
Description( "Script" ),
Text( Center Justified, {0.5, -1.6}, _text2_ )
), Grid Line Order( 5 ), Reference Line Order( 6 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox( 3 ),
{Left( 1 ), Right( 1 ), Top( 0 ), Bottom( 1 ),
Add Graphics Script(
2,
Description( "Script" ),
Text( Center Justified, {0.5, -1.6}, _text4_ )
), Add Graphics Script(
3,
Description( "Script" ),
Text( Center Justified, {0.5, -1.75}, _text5_ )
), Grid Line Order( 5 ), Reference Line Order( 6 )}
)
)
)
);
gbe = Eval (substitute(Name Expr (gb), Expr (_Yname_), Clist [i],
Expr ( _text0_ ), char( column( dtSum, Clist[i] )[1] ),
Expr ( _text1_ ), char( column( dtSum, Clist[i] )[2] ),
Expr ( _text2_ ), char( column( dtSum, Clist[i] )[3] ),
Expr ( _text3_ ), char( column( dtSum, Clist[i] )[4] ),
Expr ( _text4_ ), char( column( dtSum, Clist[i] )[5] ),
Expr ( _text5_ ), char( column( dtSum, Clist[i] )[6] )
));
gbe << journal;
gbe << close window;