Alteryx Designer Desktop Discussions

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

Find and Replace in a Loop

Sanjay_TVA
7 - Meteor

HI ,

 

I have two sources, one contains records along with state, the second source is a lookup file which contains all the information along with states, districts, so and so.

 

What I need to do is from the source I have to take state column and match up with the lookup state column and get the districts which are in that state alone for that particular record and then use find and replace it with that address column to get that corresponding districts.

 

The Source File:

Capture.PNG

The Lookup File:

Capture1.PNG

For each records I have to do it in a looping manner and take that respective districts alone for consideration and then find and replace for that group alone for each records.

 

P.S: I cannot use all the districts for find and replace because it affects the integrity of the data and I tried unique in lookup and find and replace but that doesn't work too!

 

11 REPLIES 11
atcodedog05
22 - Nova
22 - Nova

Hi @Sanjay_TVA 

 

Interesting scenario. I think it can be solved by using

 

1. Join on states

2. use contains formula in filter tool like Contains([Address],[District])

 

If you provide the sample as form of a file i can take a look into it. 

 

Hope this helps 🙂

Qiu
20 - Arcturus
20 - Arcturus

@Sanjay_TVA 
Is it possible to give a sample output?

Sanjay_TVA
7 - Meteor

Hi .@atcodedog05 and .@Qiu ,

 

Thanks for the help! Actually the logic works 👌, but when using find and replace it fails. Is it possible to construct something based on Find and Replace! 😉

atcodedog05
22 - Nova
22 - Nova

Hi @Sanjay_TVA 

 

You need to share the file also. The workflow wont run without the file.

Sanjay_TVA
7 - Meteor

Hi .@atcodedog05 ,

Sorry! Attached the new file and also the lookup is just a sample provided here but when goes through full records it generates more than a million records.

Qiu
20 - Arcturus
20 - Arcturus

@Sanjay_TVA 

Is this something you need?

1229-Sanjay_TVA.PNG

Sanjay_TVA
7 - Meteor

.@Qiu  This is what I mentioned above if we use all the districts then see the districts column which totally differs from the given address from the state it randomly takes up the first district present in that state.

 

Also on the second level if I use another component with find value as district we can see for records 3,4 the state populated will be wrong.

Qiu
20 - Arcturus
20 - Arcturus

@Sanjay_TVA 

Finally get what you mean. I think your original workflow was only missing a fomula tool.

1229-Sanjay_TVA-1.PNG

atcodedog05
22 - Nova
22 - Nova

Hi @Sanjay_TVA 

 

My take on this

atcodedog05_0-1609231852287.png

Hope this helps 🙂 Feel to ask if you have any questions

Labels