Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
Level IV

## Graph Builder

I am using a Function to create multiple plots based on different conditions.  Sometimes it calls for me to exclude (extreme outliers) rows in order to better fit the graph when presenting it to our customers.I tried to use a global flag to set whether or not it that box needs to be deleted but as i found out yesterday there are possibilites when the flag will = 1 however the test condition has no Textbox( 5 ).

The text box automattically gets its own slide so I need to remove it.

Any help would be appreciated

GraphPlot = Function(

{dt, Yaxis },

Eval(
Substitute(
Expr(
gb = dt << Graph Builder(
Invisible,
Where( dt:chnl == chan & dt:astate == attn & dt:pstate == phas ),
//					Size( 1440, 1040 ),
show control panel( 0 ),
show legend( 0 ),
Subtitle Alignment( "Left" ),
Show Subtitle( 1 ),
Variables(
Y( Eval( Yaxis ) ),
X( :FREQ_GHz ),
Group X( :wafer_number ),
Overlay( :RowCol )
),
Elements( Smoother( X, Y, legend( 19 ), lambda( 0.0001 ) ) ),
)
),
Expr( plot ), plot,
Expr( chan ), chan,
Expr( attn ), attn,
Expr( phas ), phas,
Expr( mode ), mode,
Expr( tst ), tst
)
);

Report( gb )[Axisbox( 1 )] << Min( 7 ) << Inc( 1 ) << Add Ref Line( 8, "Solid", "Black", "m106", 1 ) << Add Ref Line( 17.5, "Solid", "Black", "m105", 1 ) << Label Row( Show Major Grid( 1 ) );

Report( gb )[Axisbox( 2 )] << Inc( 2 ) << Minor Ticks( 1 ) << Label Row( Show Major Grid( 1 ) );

(gb << Top Report)[Text Box( 1 )] << Delete;

// This may or may not happen on every condition
// I tried creating a flag when i actually exclude parts however
// The flag is global and not specific on a test condition

If( excludeFlag == 1, Report( gb )[Text Box( 5 )] << Delete );

Report( gb )[Framebox( 1 )] << Frame Size( 781, 655 );

Report( gb )[Outline Box( 1 )] << Set Title( Eval Insert( WaferListSQLString || " ^tst^" ) );

Report( gb )[Text Edit Box( 2 )] << Set Font Size( 15 ) << Set Font Style( "Bold" );

Report( gb )[Text Edit Box( 1 )] << Set Font Size( 25 ) << Set Font Style( "Bold" );

);
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Staff

## Re: Graph Builder

If you are not sure if the deletion will succeed but instead cause an error condition, you might use it as an argument to the Try() function. There might not be any Text Box objects or there might be more than one. I would check the text if you find the first one to be sure that it is the one you want to delete.

Try(
text = (gb << Top Report)[Text Box( 1 )] << Get Text;
If( Contains( text, "what I am looking for" ),
(gb << Top Report)[Text Box( 1 )] << Delete;
),
Throw( "No text box found." );
);
Learn it once, use it forever!
3 REPLIES 3
Highlighted
Staff

## Re: Graph Builder

If you are not sure if the deletion will succeed but instead cause an error condition, you might use it as an argument to the Try() function. There might not be any Text Box objects or there might be more than one. I would check the text if you find the first one to be sure that it is the one you want to delete.

Try(
text = (gb << Top Report)[Text Box( 1 )] << Get Text;
If( Contains( text, "what I am looking for" ),
(gb << Top Report)[Text Box( 1 )] << Delete;
),
Throw( "No text box found." );
);
Learn it once, use it forever!
Highlighted
Level IV

## Re: Graph Builder

I tried If( Is Scriptable( and it didn't work.. I never thought of checking to see if there was text in it..

Thank you
Highlighted
Super User

## Re: Graph Builder

I am not exactly sure what your question is.  But if you are saying that sometimes Text Box(5) is not there when you have detected an excludeFlag == 1 and that is causing an issue, then you can resolve that by using a Try() function

If( excludeFlag == 1, Try( Report( gb )[Text Box( 5 )] << Delete) );
Jim
Article Labels

There are no labels assigned to this post.