Hi experts.
I have a linked summary table, in which i select rows, based on a criteria.
In my main table, I now need to set a specific value in a column, for the selected rows.
I have made a basic table with the following:
Sample error
s1 0
s1 0
s1 0
s2 0
s2 0
s2 0
I have some very simplified code as an example:
dt = current data table();
dt_sum = dt << Summary(
Group( :sample),
Freq( "None" ),
Weight( "None" )
);
dt_sum << select where (:sample == "s1");
r = dt << get selected rows;
close(dt_sum, nosave);
column(dt, "error")[r] = 1;
The code runs, if the dt_sum is closed. In my code however, this is not possible, as it is needed later.
I get the following error, if dt_sum is not closed
"Cannot set value for the column 'error' because the row number (-1) is not valid.{1}"
Further more, the error value for line 1 and 4 is changed to 1, but not the rest.
Can any of you explain me why this is not working, or help me with a possible workaround?
Thanks in advance, Anders