Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

adding string variables

Pioneer
Pioneer

I have a table of values with 2 decimal places. I need to sum these values in the table in a variable. I set the data type in the table to string, as integer returned an error. however when i come to add these values in a variable, i get a long string of values next to each other, rather than summing the values. what format do these numbers need to be in so that i can keep the decimal place but add the values and also be able to reset the variable to 0 using the 'reset' method?

many thanks for your help

2 REPLIES 2

Betreff: adding string variables

Gears Phenom Gears Phenom
Gears Phenom

well you should use the datatype "real" for your columns; if you still get errors, you have invalid values in your table-column (like text, or you are maybe using a decimal comma instead of a period). Then you can easily sum up the values in your table like this (don't use a for-loop to do this Smiley Happy ):

variable := table.sum({1,1}..{1,*})

Regards,
Alex

___________________________________________________________
Alex Dilg, Consultant at SimPlan AG (www.SimPlan.de)
This post was good and/or helpful to you? Please provide some Kudos, thank you!

Betreff: adding string variables

Pioneer
Pioneer
great thank you!