I am hoping there is a community member that can solve your question better than the method that I used below. Given what you want, there are conflicting issues in trying to use the selection capability of the data table, but then you want to clear the selections. That would force the recalculation of the formula. So what I have done, is to have the formula create a subset of the data table, perform your calculations on the subsetted data table( isolating the selections) and then reading the results from the subset back to the original data table....and then deleting the subsetted data table. Take a look and see if you understand what I am doing. It appears to work.
If( Row() == 1,
dt = Current Data Table();
dt << Select Columns( :Column 1, :Column 2 );
dt2 = dt << subset(
private,
dt,
selected rows( 0 ),
selected columns( 1 )
);
dt2 << Select Duplicate Rows();
dt2 << Name Selection in Column(
Column Name( "MultipleData" ),
Selected( 1 ),
Unselected( 0 )
);
);
x = dt2:MultipleData[Row()];
If( Row() == N Rows( dt ),
dt << clear column selection;
Close( dt2, nosave );
);
x;
Jim