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!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Compare and Match align fields data

Niranjan123
8 - Asteroid

Hello All,

how to align the field1 data based on field2 matching data in alteryx. please find the expecting output.

Kindly Suggest me.

 

RAW Data:

Field1Field2
[Null]I
LC
IG
CK
GL

 

 

Result

Field1Field2Matching Level
[Null]I1
IG2
GL3
LC4
CK5


Thanks in Advance
NR

 

6 REPLIES 6
PeterA1
Alteryx
Alteryx

@Niranjan123 

 

This can be done using an iterative macro. 

 

I have attached a workflow package containing a macro I built which will give leveling information based on the input format you provided.

 

Essentially we needed to create something that loops through the data row by row and matches the Field 2 of the Row -1 with the Field 1 of the current row. 

 

Below is a screenshot of the internals of my macro. 

 

 

clipboard_image_0.png

 

 

geraldo
13 - Pulsar

Hi

 

A suggestion without using macro is based on this example that you passed

Follows attached workflow

 

 

[]

 

 

benakesh
12 - Quasar

Hi @PeterA1 ,

Can you attach file again  .  I can't  find  macro in yxzp .  

PeterA1
Alteryx
Alteryx

Hi @benakesh 

 

Is the macro appearing as a question mark box?

 

I have attached the  macro separately now so this should work. Let me know if not. 

 

Also, if you map your macro folder they can appear in your tool palette.

 

There will be a tool category called macros that will contain all .yxmc macro files you save to that file location.

 

Shown here in User Settings:

 

clipboard_image_0.png

 

 

 

benakesh
12 - Quasar

HI @PeterA1 ,

Your macro helped me  resolve my error.

Thanks!

 

benakesh
12 - Quasar

Hi @PeterA1 ,

Your macro helped me  resolve my error.

Thanks!

 

Labels