Hello,
I am new to JMP 16 and JSL but I am an experienced programmer.
For some reasons I want to use the "Map Value" function but this gives me wrong results.
What i want to achieve is to remove unwanted items given as a list from a list containing numbers and strings
The following function constructs a list for "Map Value" named na_values in the form {option1, 0, option2, 0, ...} from the na_list e.g. {option1, option2 ,...}
and filters it using "Filter Each" and the Map Value" function.
wrap = function({filtered list,na_list}, {Default Local},
na_values={};For Each( {value}, na_list, na_values=Insert(na_values,value);na_values=Insert(na_values,1););
return(Filter Each({value}, filtered list, Map Value(value, na_values, Unmatched(0))==0;));
);
But it gives a wrong result if I call the function again with other parameters:
Show(wrap({"b",1, 2, 3},{"b"})); // <-- returns {1,2,3} => OK
Show(wrap({"d",1, 2, 3},{"d"})); // <-- returns {"d",1,2,3} => NOT OK, should be as above {1,2,3]
What is wrong here? A bug in JMP? I am using version 16.0.0 (512257).
Best regards,
Thomas