Saxon 1 Posted December 11, 2013 Report Share Posted December 11, 2013 Hi everyone, long time no see! My problem is that I'm getting "cannot add two strings together" even though I'm trying my best to make sure it's parsed as a math expression. Pretty basic you would think! #total_revenue: 0Cannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two stringsCannot multiply two strings19I have a table, and I'm trying to remove duplicate rows. What I'm doing is saving each row to a list and then allowing the list to remove duplicates: set(#remove_dupes_counter, 0, "Global") loop($table total rows(&comms_refined_one)) { set(#ref_one_holder, "{$table cell(&comms_refined_one, #remove_dupes_counter, 0)},{$table cell(&comms_refined_one, #remove_dupes_counter, 1)},{$table cell(&comms_refined_one, #remove_dupes_counter, 2)},{$table cell(&comms_refined_one, #remove_dupes_counter, 3)}", "Global") add item to list(%removedupes, #ref_one_holder, "Delete", "Global") increment(#remove_dupes_counter) } Then I save the list to a csv file, and I make a new new table from it (yes this is very hacky but I've had to try a lot of things to make this work!): save to file("{$special folder("Application")}\\listcache.csv", %removedupes) create table from file("{$special folder("Application")}\\listcache.csv", &comms_refined_two) The CSV file looks correct when I open it outside ubot. To me it looks like I can create a new table from this file and columns 2 and 3 should be read as real numbers: admin@email.com,email@yahoo.com,0009,9.5 support@email.com,Accounting@email.com,0001,7.6 support@email.com,email@gmail.com,0009,7.6 The error comes when I try to do this: set(#total_revenue, $add(#total_revenue, $multiply(#makemath, 2)), "Global") This is an extra step but I created a variable called #makemath to hold the last number in the new table I created above, but that didn't work either.: set(#makemath, $table cell(&comms_refined_two, #refined_comms_count_2, 3), "Global") Anyone got any ideas? I need to either make the numbers = numbers and not strings, or think of a different way of removing duplicate rows from the table altogether. Cheers! Quote Link to post Share on other sites
Saxon 1 Posted December 11, 2013 Author Report Share Posted December 11, 2013 I should also add I tried creating the first variable like this too: set(#ref_one_holder, $add($add($add($add($add($add($table cell(&comms_refined_one, #remove_dupes_counter, 0), ","), $table cell(&comms_refined_one, #remove_dupes_counter, 1)), ","), $table cell(&comms_refined_one, #remove_dupes_counter, 2)), ","), $table cell(&comms_refined_one, #remove_dupes_counter, 3)), "Global") So I tried with the table cells outside "" and {}. Quote Link to post Share on other sites
Saxon 1 Posted December 23, 2013 Author Report Share Posted December 23, 2013 I guess I'll test this in V4 and see if it's a V5 bug. Quote Link to post Share on other sites
Saxon 1 Posted December 23, 2013 Author Report Share Posted December 23, 2013 It worked in 4.2.20, so it's a v5.05 bug. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.