# Alteryx Designer Discussions

It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
SOLVED

## Parse data

Highlighted
8 - 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 route Current point Passed route Next route [number-number...]-388-[number-number...]-388-[number-number...]-388-201 388 [number-number...]-388-[number-number...]-388 388-[number-number...]-388-201 [number-number...]-388-[number-number...]-388-[number-number...]-388-201 388 [number-number...]-388 388-[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

Highlighted
12 - 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.

8 - 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

Highlighted
12 - 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.

Highlighted
8 - 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 route The passed route Current point Next route input dataneed to bring the right part of this string input dataneed to count how many times the current point is in this string = N input data output dataThe right part of the string "The whole route" after N appearance of the current point
Highlighted
12 - 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.

Highlighted
8 - 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"

Highlighted
12 - 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