Alteryx Designer Desktop Discussions

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

Splitting records as per length and name referring from another file

hf14
8 - Asteroid

I have this complex data (FileA) and I want to split its each row into separate columns referring the Reference file.

In Reference file its given- Filed name and the length 

 

For ex- If first row is --  FS020101XWARPLCFRPT000

And Reference file's first row has- Field name= Tradetype and Length= 1 and second row-  Field name= Side and Length= 2

Then my output will have: 

 

hf14_0-1663945239447.png

 

How can this be solved in alteryx?

 

4 REPLIES 4
binuacs
20 - Arcturus

@hf14 just wanted to confirm whether the field length mentioned in the reference file is correct or not. The trade type field length mentioned as 1 and SideID also mentioend as 1 but in your output it is S0, which is 2 in length. Can you confirm?

binuacs
20 - Arcturus

@hf14 Here is the one way of doing this. I dont think the reference field length is correct but you can adjust that in the regex tool in the workflow

 

binuacs_0-1663946434290.png

 

DataNath
17 - Castor

Hey @hf14, here's how I'd go about this. This approach is fully dynamic if you were to add or take away from the reference file:

 

DataNath_0-1663948392662.png

 

As mentioned above, the [SideID] column may look incorrect as the length is 1, but in the reference file you provided the length for this field was given as 1 unlike your original post where you said 2.

hf14
8 - Asteroid

Thank you so much, both the solutions work well!

Labels