community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Parse data

Asteroid

Hello everyone!

I have the following problem:

I need to parse the Next route. Don't know how describe the task in words so let me explain it on the example.

 

[number-number...] means that there can be any number delimited by "-".

The whole routeCurrent pointPassed routeNext route
[number-number...]-388-[number-number...]-388-[number-number...]-388-201388[number-number...]-388-[number-number...]-388388-[number-number...]-388-201
[number-number...]-388-[number-number...]-388-[number-number...]-388-201388[number-number...]-388388-[number-number...]-388-201

So if current point appears 2 times in passed route than I need to delete data after second appearance of the current point. If current point appears 1 time in passed route than I need to delete data after first appearance of the current point. If current point appears 3 times in passed route than I need to delete data after third appearance of the current point. Etc

Quasar

@Nastya This is a bit complicated and there may be (and probably is) a simpler route to get there, but this should accomplish what you're looking for. In situations like this splitting your data into rows has been the best route in my experience.

 

route parse image.PNG

Asteroid

thank you very much!!!

Don't you mind if I won't push "Accept as solution" button? In hope that easier solution can be found

Quasar

It's early. There's a much simpler solution.

 

EDIT: However, this would only work in the situation where none of your locations are substrings of other locations (ie. 388 and 15388). That's parsing the routes into pieces is a safer path.

 

 

route parse simpler.PNG

 

473a16cbacd642321b7187bb882dc2b3--book-jacket-we

Asteroid

Sorry, I didn't check the previous solution. It seems to me you wrongly understood me

Hm, as I see it's not exactly what I need

The whole routeThe passed routeCurrent pointNext route

input data

need to bring the right part of this string

input data

need to count how many times the current point is in this string = N

input data 

output data

The right part of the string "The whole route" after N appearance of the current point

Highlighted
Quasar

Apologies. Attached is a revised version. Once again a bit complicated but should work. The simpler version posted earlier works only in situations where the locations are never substrings of other locations.

 

 

Asteroid

But there is again only 2 input column.

The passed route is given in the input. And we should use it to count number of appearance of current point in it

And other actions are done with the string "The whole route"

Quasar

Is there a way you can share your input data by attaching the file as formatted? that will be the simplest way to ensure this matches what you're looking for. 

Labels