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

Parse data

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

7 REPLIES 7
neilgallen
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.

 

route parse image.PNG

Nastya
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

neilgallen
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.

 

 

route parse simpler.PNG

 

473a16cbacd642321b7187bb882dc2b3--book-jacket-we

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

neilgallen
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.

 

 

Nastya
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"

neilgallen
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