Alteryx Designer Desktop Discussions

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

Find all combinations within a range that sum to a specific value

csh8428
11 - Bolide

I have 5 columns. Each Column has a pre-defined range. I'm trying to figure out all the combinations of summing the 5 columns while staying within the ranges that equal a specific value(164 in this case). 

 Column 1Column 2Column 3Column 4Column 5
Range0-1010-2025-3540-5050-55

 

One constraint is that a number can't be duplicated in any of the columns along that row. For example using the ranges in the table, if Column 1 value = 10, then Column 2(or any other column) can't also be 10 for that row. I'm guessing this could be done using R, but I've never coded anything in R before.

 

Thanks for any help!

 

-Craig

4 REPLIES 4
PhilipMannering
16 - Nebula
16 - Nebula

👋 Craig.

 

I think this does the job,

PhilipMannering_0-1659563829216.pngPhilipMannering_1-1659563857467.png

 

Qiu
20 - Arcturus
20 - Arcturus

@csh8428 
Not as elegant as the one from @PhilipMannering .and I made this to be static.
With a bit more effort, we can make a dynamic though.

0804-csh8428.PNG

PhilipMannering
16 - Nebula
16 - Nebula

@Qiu Your way runs a lot quicker by virtue of it being Alteryx only.

 

Reassuring that we got the same number of records!

Qiu
20 - Arcturus
20 - Arcturus

@PhilipMannering 
Thank you for the confirmation. Glad to know that.

Labels