Alteryx Designer Desktop Discussions

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

Find and Replace question

Sophia_Xiao
7 - Meteor

Hello, Can Alteryx help replace the frequency column to "Weekly" as long as there is "Weekly" record under the same product code? Thanks

 

4 REPLIES 4
DataNath
17 - Castor

Hey @Sophia_Xiao, here's one way you could go about it:

 

DataNath_0-1667817577896.png

 

Here I'm checking the distinct frequencies of each code, isolating those that are 'Weekly' and then joining back onto the main data set based on that, which automatically carries the 'Weekly' flag through with it to all records. Those that don't join are 'Non-Weekly' and we therefore just union them back on to finish.

 

Edit: Remembered that, within the Summarize tool, 'Shortest' is one of the string options and therefore we can just use this - those codes which contain 'Weekly' will return this whereas if that's not present, 'Non-Weekly' fill be the only frequency and therefore the shortest. Again, we just join back on code and use this isolated frequency as the flag.

 

DataNath_0-1667817866378.png

Sophia_Xiao
7 - Meteor

@DataNath 

 

Thanks, can we use multi-row filter to achieve. As I am working on a big data set with a already quite complex workflow in place, trying to find a solution to resolve using one tool or two tools. Could we achieve that. The flow you are using join and union will really take extra quite long time to complete the whole Alteryx flow.

DataNath
17 - Castor

Hey @Sophia_Xiao apologies, I made an edit after posting which contains a more refined (2 tool) option here. The workflow relating to that one is the one ending in '- Alt'.

 

There is also the option to do something like the following, where we sort on the frequency so that 'Weekly' will always appear first (if present). We then fill down based on that:

 

DataNath_0-1667818399892.png

Sophia_Xiao
7 - Meteor

@DataNath Thanks, that's really smart but I cannot use join tool. I notice join tool really take quite a long time to process when dealing with a big dataset. I will accept the solution. But if you have a better idea please kindly help. Thanks

Labels