We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Finding which values from the same column added together give me a given number

jmrossetti
5 - Atom

I have an expense of say 1,500, and I have an invoice of 100,000 in total... none of the individual expenses of the invoice is 1500 so I have to find which of all those added together give me 1500... when they are few there is no problem you can search manually, when they are a little more I can do it in excel using solver but here I have more than 350 and I wanted to see if I can make a workflow in Alteryx to do it.

Does anyone know how?

5 REPLIES 5
binuacs
21 - Polaris

@jmrossetti would you be able to provide and input file and expected output?

Raj
16 - Nebula

please share sample input and required output

jmrossetti
5 - Atom
StateQTYAmt Due
NY1801,621.93
KY731,582.59
TX681,563.98
KS631,544.52
OH1381,518.16
CA421,494.20
FL1001,484.22
CA661,476.69
GA1941,467.84
MD471,459.47
VA461,454.09
NJ591,448.74
MI651,402.25
IL861,389.88
NY641,358.03
IL591,309.47
CA501,305.72
OH1431,285.72
TX461,284.34
TX631,277.09
CT391,271.63
NY471,246.80
MI421,243.83
IL421,196.99
DC811,191.96
FL411,178.64
TX541,137.78
IL401,137.70
DC301,124.48
FL351,104.31
CA371,091.62
MA1071,042.34
NV261,041.50
NC331,039.25
NY421,038.78
NJ371,005.30
AK36982.81
OR38963.46
CA24946.78
AZ20927.16
FL37918.00
OK85886.31
CA31882.91
AZ27874.82
LA26869.83
FL66867.71
CA37861.63
CA52850.64
CA91848.88
MI10848.00
NY38847.08
TX98827.43
CA23806.73
MO26798.42
MO18791.76
MI15787.60
CA17780.05
CA19777.96
NY30775.61
MD22771.10
VA25755.77
PA39750.71
NE28750.70
AZ30748.02
NV19738.93
CA17727.56
IA22705.92
IL30701.86
SC16696.10
NJ25687.06
AL16651.87
GA51651.38
TX28642.52
GA43641.40
FL23637.76
CA17635.36
CO20629.99
CA31612.97
TN15612.26
TX13612.26
AZ22603.37
OH22601.62
FL81594.68
CA26593.02
ME22592.72
NM18590.16
MD25584.55
OR18568.27
VA15568.17
CA22564.76
MI16560.60
FL45560.02
MN19552.22
PA16547.44
SC44544.79
CA18542.94
WA18540.47
NY23525.96
TN17525.68
TN15523.06
PA12520.59
FL17520.14
WI20517.20
NJ19516.12
WI17514.58
CA19511.19
NY18508.42
KS24506.20
FL19500.22
AR21493.74
UT13492.57
CA59492.47
TX17488.16
MN18486.64
PA19484.95
CA15480.50
GA22475.76
UT57475.50
AL10474.47
NJ14468.59
MD16468.00
DE14467.49
NJ17467.02
CA12461.41
CA18452.33
CA42452.32
TX12451.76
NY14445.39
NJ16440.49
VA13438.25
RI14435.83
CO16431.01
MI29421.59
OH17417.84
OH27404.63
GA12403.31
PA16396.51
CA9394.42
CT14393.12
NJ14393.12
CA9383.48
NY14382.10
MA8381.98
PA15381.32
WI11376.52
CT12373.75
MA40373.45
NC13372.09
CA10370.02
UT14370.00
WA11367.98
OH14367.22
FL12362.07
MD12359.27
PA14356.50
MA31354.52
VA16354.34
WV18352.14
NJ13349.27
VA14348.50
ON35346.60
VA9342.87
FL13341.76
CA14338.36
OH17338.30
PA8336.42
NY14336.08
CA10329.48
CT12327.84
MI11326.29
CA37324.64
MI11321.82
TN11320.73
NM8319.99
NC8318.01
CO12314.36
FL12310.36
SC11308.99
FL27307.90
CA4307.75
NY12307.33
CA7302.90
FL14300.93
CA3300.00
CA6299.36
CA10299.04
OH12297.82
TX14297.40
AL8296.68
WI11295.64
CO7295.38
NJ14294.49
PA27293.99
CA8293.38
MS9292.76
PA8283.70
AB20282.77
AL10280.56
MA9278.40
MO10277.95
FL13275.44
FL9274.76
NC11272.65
IL12268.72
MD7267.86
MA28262.18
WI13261.82
IL7261.65
OH9255.00
FL10252.37
DE10249.96
SD7240.51
NJ10239.36
MI6238.15
AL7237.46
GA15232.20
AZ5230.26
MD9227.62
NY11227.47
MI6226.15
FL7225.02
CO6222.61
NH7221.63
NC9220.28
MO8218.72
OH9218.55
PA8218.32
VA11215.85
NY9215.31
FL4214.00
FL3213.00
CA8212.67
CA7211.22
CA6210.98
OH7208.55
FL9206.79
NJ9205.02
PA16204.28
IL2200.00
TX8196.24
CA5196.00
FL22193.44
FL5190.36
CT7188.48
NJ7183.05
NY7176.71
WA5172.04
MN3168.52
MN3166.67
PA4166.36
CT8165.93
CA3164.52
AL5162.14
FL7160.75
MA3156.33
ND4151.30
IL4150.26
CA5149.54
AR6143.19
OR5142.78
BC12142.20
AL5140.80
MI6140.33
KY6132.49
NH6131.13
FL9129.32
NC4127.69
FL6123.57
NY9121.22
TX6120.15
PA6117.76
CT13116.91
NY4115.01
AL4113.88
IL4112.62
WA4111.66
ME5109.16
MI5109.03
WA4108.46
TX2108.25
MN2108.13
IN4106.36
DC2106.00
MD2106.00
PA2106.00
PA4105.08
TX4104.95
IN3102.85
OH4101.83
CA1100.00
CA1100.00
CA1100.00
GA596.98
CA590.59
MD389.62
TX487.89
NY387.10
NJ385.30
CO284.87
PA484.80
PA484.80
AL480.40
NJ280.00
CA178.00
CA178.00
CA178.00
CA376.26
OH473.70
ID1073.17
VT370.66
FL367.36
WA467.15
NY464.80
TX263.36
RI963.18
VA362.33
TX361.61
IN259.63
NY652.66
TN349.16
WA244.12
OR144.00
OR243.96
FL243.75
TN243.70
NY243.55
NY243.25
NY243.20
FL243.00
NC243.00
NC242.90
IA242.80
NC242.80
NJ242.65
NJ242.65
NJ242.65
VA242.40
CA240.68
CA140.00
CA140.00
CA140.00
IL140.00
PA140.00
WY539.90
TN338.91
CT231.91
NJ128.08
GA326.73
FL122.62
LA220.68
DE213.32

 

I need to find wich of all the amounts listed added together result 1742.26 

BS_THE_ANALYST
15 - Aurora
15 - Aurora

@jmrossetti that's actually fairly tricky. There could be loads of computations that add together to reach your target. 

Anyway, after a little digging, it's apparent you might need some type of algorithm:

BS_THE_ANALYST_0-1679401272286.png

You could use the Python tool alongside Chatbot GPT to provide the algorithm, i.e. Backtracking:

BS_THE_ANALYST_1-1679401335332.png

I fed only 30 numbers into this and produced those combinations. The thing is, once you have lots of numbers, the time it takes to compute all the different scenarios will grow significantly:

BS_THE_ANALYST_2-1679401399699.png

 

 

 

 

All the best,
BS

LinkedIN

Bulien
jmrossetti
5 - Atom

Thank you for taking the time!! 

Labels
Top Solution Authors