Hello everyone,
I have a that contains multiple customers and their transactions. For each customer, I have a certain amount I am trying to identify which transaction amounts add up to that specific amount. I tried looking online and some posts state to use the "Optimizer" tool, but I can't figure out for the life of me how to configure it for my purpose or if there was an easier way of going about it in Alteryx.
I attached a test file. You will see there are two customers, "Apples" and "Oranges". In column K I have the target amount for each customer (Apples = 206.39 and Oranges = 2944.4) and I highlighted the amounts that sum to that customer's specific amount. Does anyone have experience with the "Optimizer" tool to help achieve this and to scale it for when the file has many customer transactions?
Solved! Go to Solution.
I realise that I don't have the solution below, but hopefully points in the right direction.
Also, this is the matchematical problem you're trying to solve: https://en.wikipedia.org/wiki/Subset_sum_problem
There are a couple of things to consider here.
By the optimizer tool, does that mean the Optimization tool? If so, that is a predictive tool and may need hard boundaries to get exact matches. It's designed to optimise a process such as timesheeting, call centre response times, stock inventory etc.
Take a look at the Knapsack problem, if you want to pursue that. It's based around optimising the space in a knapsack by filling it as much as possible. Hopefully using that principle you'll be able to get exact every time. There may be actual training on the academy for it as well, as I know I showed the knapsack problem at 2 Inspires in training for the optimisation tool.
For Brute force,
Other options may involve adding transactions in decreasing size until you get close but will be super iterative.
@RCern
Your question reminds the Bin packing problem and maybe we can try that approach.
First I would filter out the record having "Amount in Bank" larger than "Target amount", then reuse the discussion here with an iterative macro.
I am not sure it this works for your larger dataset but at least it works for your sample dataset.
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/HELP-How-to-use-ITERATIVE-MACRO/m-p/92...