Hi everyone!
I have the following problem
0 - remove, 1 - keep
0
I need to create the column "Output". If number = mark => keep, if number doesn't equal to output => remove
Thanks!!
Or,@nastya, take look at attached workflow, see if it does the job.
Assigns record ID which is used in two ways:1, Identify first appearance per Number (later used to assign Output)2, Re-sort data at end back to its original order (since we will sort within workflow)
Summarize tool then gets first appearance per each Number.
This is then joined back to the original data (with record ID included); which then populates a field called "first_occurrence" with Y if that's the first appearance of that Number, but otherwise populates with N.
Then the data is sorted by Number (ascending/descending doesn't matter) and "first_occurrence" (descending - DOES matter, because this puts the first record per Number at the top of results for that Number).
Multi-field tool then assigns Output with this formula:
if [first_occurrence] = 'Y' and [number] = [mark] then '1'elseif [first_occurrence] = 'Y' and [number] != [mark] then '0'else[row-1:output]endif
There are only 3 possibilities per record here: It's the Number's first appearance and Number equals Mark (output 1); It's the Number's first appearance and Number does NOT equal Mark (output 0); it isn't the Number's first appearance (take the output from the Number's first appearance).
Then we re-sort data to its original order; and a select tool scopes it down to only the incoming fields plus output field.
You can create the Output field using the following formula:
IF [Mark]==[Number] THEN 1ELSE 0 ENDIF
I have attached a solution that shows how to implement this formula.
Hi @Nastya
Do you actually want to remove the rows or just set the Output to 0 or 1?
To create the column use standard Formula tool, to remove add a Filter tool.
Sorry! I've just understood that my example is not complete
So 1 after first match of "Number" and "Mark" the output for all next rows musk keep the same