I have a script that creates a formula based on the contents of an object. In some instances, the entry that fills in the object is bypassed. N Items(yVars) ==0 in that case. How can I have the formula calculate without the column reference if empty?
The case below is overly complex where I check for the presence of an entry and use an If() statement to create alternative actions.
If( N Items( yVars ) == 0,
Data Table( "HIRP" ) << New Column( "Average PTC",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
Col Mean(
Col Maximum( :Power, :Heater, :HD_NUM ),
:Heater,
:WAFER_SUBSTRATE_LOT_ID_IDX
)
)
),
Eval(
Eval Expr(
Data Table( "HIRP" ) << New Column( "Average PTC",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
Col Mean(
Col Maximum( :Power, :Heater, :HD_NUM ),
:Heater,
Expr(
Name Expr( As Column( Divider ) )
)
)
)
)
)
)
);