I want to recode multiple columns using a conditional formula by going through each column with a For Each function. I am not able to recode successfully with the following code:
//Create list of columns to be recoded
ColNames = {dt:Name( "col 1" ), dt:Name( "col 2" ), dt:Name( "col 3" ), dt:Name( "col 4" )};
For Each( {listitem}, ColNames,
Recode(
listitem,
{Lowercase( _rcNow ), If( Contains( _rcNow, "too much" ),
"1000",
_rcNow
), Regex( _rcNow, "\D*(\d+\.?\d*)\D*", "\1", GLOBALREPLACE )}
)
);
My hunch is that the body of the For Each clause is incorrect -- that I have to somehow call out the columns more clearly.
The data table as "dt" is established earlier in the code. For the record, I don't get an error when I use the script but the columns are not recoded properly. Thanks.