When copying the table script for a summary table you actually want to copy the 'source' script that is automatically attached to the new data table. That script is usually pretty short and does not have New Column syntax in it (if you added new columns after the tabe was created you would first run the source script and then add the new columns). Try opening your data table and running this:
dt = current data table();
//Summary Table
dtSum = dt << Summary(
Group( :Month Year ),
Sum( :Count ),
Subgroup( :Recordable ),
Freq( "None" ),
Weight( "None" ),
output table name( "Sum of Count by Month" )
);
//Chart
dtSum << Control Chart(
Sample Label( :Month Year ),
Sample Size( 250 ),
KSigma( 3 ),
Chart Col( :Name( "Sum(Count, Near Miss)" ), C ),
Chart Col( :Name( "Sum(Count, Non-Record)" ), C ),
Chart Col( :Name( "Sum(Count, Recordable)" ), C ),
SendToReport(
Dispatch(
{"C of Sum(Count, Near Miss)"},
"Attributes Chart",
FrameBox( 2 ),
{Frame Size( 64, 208 )}
)
)
);