Hi all,
Firstly wanted to say I'm loving using Alteryx so far! Secondly, wanted to apologise in advance for misnaming anything - I'll try my best to explain what I'm trying to do!
Simplified aim: I'm trying to get to a data set of competitor restaurants which are within a given proximity of a particular brand. e.g. Find the set of restaurants near all the McDonald''s in the UK.
Now, to get the data I want it so that I limit the share of restaurants in the competitor set, so one brand doesn't exceed 50% e.g. if there are 5 fast food restaurants in the comp set, and 3 are Burger King, then I'd want to adjust the data.
So far I've tried this manually, and it works, however, as I'm a massive data geek, I want to know if I can create a loop which can do this, without me creating multiple sets.
I have the data ranked by proximity at the moment, so I'm only picking the nearest 7 restaurants to a given McDonald's. Then I have tested if any brand accounts for over 50% of the competitor set. My manual flow says... if it has more than 50% of one brand, add the next nearest restaurant than isn't the brand that has the highest share of compset i.e. if there are 60% Burger King in the set, add the nearest brand that isn't Burger King. I've done this latter part manually, but repeating the flow a few times i.e. at the 7th closest restaurnt... test... add the 8th.... test.
Is there a better way to do this which says..... Test if comp set >50%, if so add the next closest until that condition is met. Is there a tool in the palette I've overlooked, I suspect I've overcomplicated this! Some of the similar posts in here talk of macros, but their problems are more complex than mine.
Thanks in advance to anyone that can help!