Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.
SOLVED

Identifying Similar records and marking according to its code

AS
8 - Asteroid

Hi Experts,

 

I'm new in Alteryx development. Please help me in a logic and finding activities.

I have similar number of Doc id and I want to Mark document as "Y"  if at least one line has this code "03" or "02",

as shown below.

 

This should be the expected result-

Doc Id Code Status
309203Y
309201Y
309205Y
419501N
419605N
419605N
419607N
419607N
429805Y
429802Y
429805Y

 

Thanks in Advance.

 

8 REPLIES 8
atcodedog05
22 - Nova
22 - Nova

Hi @AS 

 

Here is how you can do it.

 

Workflow:

atcodedog05_0-1626172694634.png

1. Filter rows with "02" or "03".

2. Groupby to get unique Doc IDs .

3. Using Formula tool to add Y flag.

4. Joining back Flags to data using find and replace tool (similar to vlookup).

5. Replace "N" with "Y" for Doc Ids with "02" or "03"

 

EDIT: updated with last logic.

 

Hope this helps : )

AS
8 - Asteroid

hi @

 

It's not working. Could you please check again my table

 

atcodedog05
22 - Nova
22 - Nova

Hi @AS 

 

Here is the workflow with the change.

 

Workflow:

atcodedog05_0-1626176720827.png

 

Hope this helps : )

 

AS
8 - Asteroid

Thank you so much for help

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @AS 

BetterFerret
8 - Asteroid

Don't want to step on any toes, but this problem can be solved simply by grouping on Doc Id, concatenating the Code, setting the Status by using Contains() on that concatenated value, then joining back on Doc Id.

atcodedog05
22 - Nova
22 - Nova

No issues @BetterFerret always exciting to learn different ways to solve it.

BetterFerret
8 - Asteroid

BetterFerret_0-1626197941050.png