Hello,
I am trying to write a script that creates a number of total columns for a series of products. Odd numbered columns represent total number of ounces and even numbered columns hold the number of containers. I need to multiply each pair and sum the results. I came up with a simple script below, but the resulting formula in the column doesn't contain the parenthesis needed to preserve order of precedence and the column is empty of data. Obviously I'm missing something but I can't figure out what. Attached is sample data and the script.
Thank you!
dt = currentdatatable();
New Column( "DET Current Total TD", Numeric, "Continuous", Format( "Best", 12 ), Formula(
(:Name( "DET_P51_AMT_NEW_1. TD" ) * :Name( "DET_P51_AMT_NEW_2. TD" )) +
(:Name( "DET_P51_AMT_NEW_3. TD" ) * :Name( "DET_P51_AMT_NEW_4. TD" )) +
(:Name( "DET_P51_AMT_NEW_5. TD" ) * :Name( "DET_P51_AMT_NEW_6. TD" )) +
(:Name( "DET_P51_AMT_NEW_7. TD" ) * :Name( "DET_P51_AMT_NEW_8. TD" )) +
(:Name( "DET_P51_AMT_NEW_9. TD" ) * :Name( "DET_P51_AMT_NEW_10. TD" )) ));