Hi all,
back with another question that has me stumped, trying to add a calculation to a summary by creating a new column. There is a column i am attempting to create named GD1 that I wish to sum the values in the columns N(4) and N(5) to, if they exist. Here is my attempt at checking for the existence of those columns and summing them if they exist, this seems to terminate in the debugger but I'm not seeing why:
Data Table( "Fun pull" ) << Summary(
Group( :Name( "90440011_119325" ) ),
N,
Subgroup( :Sort_Lot ),
Freq( "None" ),
Weight( "None" );
newcol1 = Expr(
Current Data Table() << New Column( "GD1",
Numeric,
"Continuous",
Formula( Sum( :Name( "N(1)" ), :Name( "N(2)" ), :Name( "N(3)" ) ) )
)
);
Eval( Eval Expr( newcol1 ) );
newcol2 = Expr(
Current Data Table() << New Column( "Test",
formula(
If( Contains( Current Data Table() << get column names( string ), "N(4)" ),
Sum( :GD1, Name( "N(4)" ) ),
If( Contains( Current Data Table() << get column names( string ), "N(5)" ),
Sum( :GD1, Name( "N(5)" ) ),
Sum( :GD1 )
)
)
)
);
Eval( Eval Expr( newcol2 ) );
);
)
Any explanation as to how this can be implemented correctly would be greatly appreciated.