Alteryx Designer Desktop Discussions

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

Multiple substrings

RasmusLindBjerre
5 - Atom

Hey there,

 

I have a question on how to use the output ([value]) as the input in a substring, meaning 0 to first entry, first entry+1 to second, second+1 to third, etc. Is there any possible way to do so? And if there is, then how? 

 

Background for data. It has been extracted without any delimiter and I would therefore like to split data into several substrings.

 

Thanks in advance!

 

dkrlbj_1-1616752532882.png

 

 

3 REPLIES 3
afv2688
16 - Nebula
16 - Nebula

Hello @RasmusLindBjerre ,

 

I am having trouble trying to understand what you need, could you please explain it with an example?

 

Regards

RasmusLindBjerre
5 - Atom

Hey @afv2688 ,

 

Sorry for the messy explanation. I've worked a bit further on this a might be able to present it better now. 

 

To clarify a bit, Field_1 contains a string of text that doesn't have any proper delimiter in it. Therefore, I have create a workflow that can dissect how wide a field should be (this widths can be seen in columns 1, ..., 7). 

 

What do I want to do with it? I want to do a substring on Field_1 using column 1,...,7. As a practical example:

The first substring should be from 0 to [1] (in this case 11). Next should be from [1]+1 to [2], all the way up to [6]+1 to [7].

 

The lowkey "bad way" of picturizing it is SUBSTRING([Field_1],0,[1]), SUBSTRING([Field_1],[1]+1,[2]), SUBSTRING([Field_1],[2]+1,[3]), etc. I hope this is a bit clearer!

 

dkrlbj_0-1616762570048.png

 

afv2688
16 - Nebula
16 - Nebula

Hello @RasmusLindBjerre ,

 

I created a macro a while ago that reads flat files and names every data specified on a csv file.

 

On this, you enter the column name, length and data type and this will configure the input.

 

Please take a look at it.

 

Regards

Labels