Hello everyone!
Throughout my workflow I have to handle the following issue.
When I have more than one PERC% value for the same KEY (like 0,17 below for KEY DEX9), I have to filter each CODE with an unique NUM.
KEY | PERC% | CODE | NUM |
BGI8 | 0,30 | E | 1 |
BGI8 | 0,70 | T | 2 |
DEX9 | 0,17 | E | 1 |
DEX9 | 0,17 | E | 2 |
DEX9 | 0,17 | T | 1 |
DEX9 | 0,17 | T | 2 |
DEX9 | 0,48 | T | 3 |
DEX9 | 0,32 | T | 4 |
AP2 | 0,16 | T | 1 |
AP2 | 0,08 | E | 2 |
AP2 | 0,35 | T | 3 |
So, for example, for KEY = DEX9 there are 6 lines, 4 of them with PERC% equal to 0,17. Therefore I have to select the row with CODE = E and NUM = 1, and row with CODE = T and NUM = 2, as shown in the resulting table below.
And I need to do this for the general case, I mean, I should always check in the workflow if I have a case like this to properly handle it.
KEY | PERC% | CODE | NUM |
BGI8 | 0,30 | E | 1 |
BGI8 | 0,70 | T | 2 |
DEX9 | 0,17 | E | 1 |
DEX9 | 0,17 | T | 2 |
DEX9 | 0,48 | T | 3 |
DEX9 | 0,32 | T | 4 |
AP2 | 0,16 | T | 1 |
AP2 | 0,08 | E | 2 |
AP2 | 0,35 | T | 3 |
I've tried to use Unique Tool in different approaches and it doesn't work.
Any ideas?
Thanks in advance!
Solved! Go to Solution.
Hi @jpscoralick
Step 1: Input tool
Step 2:
Step 3:
Step 4:
Step 5:
IF [KEY]=[Row-1:KEY] AND [PERC%]=[Row-1:PERC%] AND [ NUM]=[Row-1: NUM]
THEN [ NUM]+1
ELSE [ NUM]
ENDIF
Many thanks
Shanker V
Thanks a lot, @ShankerV and @FinnCharlton, for the fast and useful solutions. All of them work perfectly.
Best regards!