Alteryx Designer Desktop Discussions

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

Building a Checking and Replacing Section for column in the workflow

k3pineapple
8 - Asteroid

Hello All,

need help with a work flow

I am going to add a checking and replacing section in my workflow. In my raw data , the sub-products which is under the main products list under the same column header as the main products , I have already split them.

Now I create a separate sheet about list of main & sub products to add a checking and replacing step in order to convert the sub product name to the main product name.

 

I have over 10 main products and over 500 sub products under them, the single formula I built is not suitable for this, since asking for help , thank you.

 

 

Here is the example: 

the sample products (main & sub) category sheet I created:

Main Sub
Aa
Ab
Ac
Bx
By
Bz
Cab
Ccd
Cef
Cgh
Cij
Dabc
Dbcd
Defg
Eaaaa
Ebbbb
Ecccc

 

2. the filtered data:

CompanyProductSalesID
A1AbMarry123456
A1AxPeter234567
A1AyJohn345678
B2BefgAmy456789
B2BaaaaOK567890
C2CbHello 112233
C2CxHi223344
C2CabJack334455
C2CcdRose445566

 

3. Expected Result

CompanyProductSalesID
A1AAMarry123456
A1ABPeter234567
A1ABJohn345678
B2BDAmy456789
B2BEOK567890
C2CAHello 112233
C2CBHi223344
C2CCJack334455
C2CCRose445566

 

 

Attached file is the data shown above.

 

Thanks again

7 REPLIES 7
flying008
14 - Magnetar

Hi,@k3pineapple 

 

you only need use find&replace tool to get.

1- Find Within Field: [Product]

2- Find Value: [Sub]

3- Select : Entire Field , Match Whole Word Only

4- Replace Found Text With Value: [Main]

 

录制_2022_04_22_14_13_23_509.gif

Qiu
21 - Polaris
21 - Polaris

@k3pineapple 
We can use a joint to do this. :)

0422-k3pineapple.PNG

k3pineapple
8 - Asteroid

@flying008 Thank you very much for your answer, 100% match what I want here...

right now, I need to build the next step which is to revert back for these data.

Cells in the product column: Main (has been converted before, exclude the data which is main before) -> sub

Thanks again.

 

k3pineapple
8 - Asteroid

@Qiu Thank you for your help again. Like your answer.

I would like to revert these data back to the original data in the product columns now.

Details:

Main(only the data has been converted to sub before) -> Sub

e.g.

A -> b (this is the cell, that has been converted before, now need to convert it back)

A -> A (not be converted in the flow showing above)

I hope can get your help again. Thank you

 

 

Qiu
21 - Polaris
21 - Polaris

@k3pineapple 
Thank you for the feedback, I will check it later.

Qiu
21 - Polaris
21 - Polaris

@k3pineapple 
I was not sure about which one is the " original data" you mentioned. just guessing :)

0422-k3pineapple-r1.PNG

k3pineapple
8 - Asteroid

@Qiu  Thanks for the workflow, Sorry, I did not explain it clearly. this is what I want now

Matrix 1 -> 2 we have already solved

Matrix 2 -> 3 is the workflow I would like to build and being stuck there, since I need to build a flow to differentiate what products has been converted from sub to main later of the flow during the step 1 -> 2

 

For this time, I suppose in the first join," product = sub " does not work in this situation 

 

And thank you again for your help.

 

1. Original data

CompanyProductSalesID
A1AbMarry123456
A1AxPeter234567
A1AyJohn345678
A1AAMarry123456
A1ABPeter234567
B2BefgAmy456789
B2BaaaaOK567890
B2BAAmy456789
B2BBOK567890
C2CbHello 112233
C2CxHi223344
C2CabJack334455
C2CcdRose445566

 

2.Result Data

CompanyProductSalesID
A1AAMarry123456
A1ABPeter234567
A1ABJohn345678
A1AAMarry123456
A1ABPeter234567
B2BDAmy456789
B2BEOK567890
B2BAAmy456789
B2BBOK567890
C2CAHello 112233
C2CBHi223344
C2CCJack334455
C2CCRose445566

3. Result revert

CompanyProductSalesID
A1AbMarry123456
A1AxPeter234567
A1AyJohn345678
A1AAMarry123456
A1ABPeter234567
B2BefgAmy456789
B2BaaaaOK567890
B2BAAmy456789
B2BBOK567890
C2CbHello 112233
C2CxHi223344
C2CabJack334455
C2CcdRose445566

 

Labels