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.

Is it possible to get a set number of records to meet a predetermined sum?

gmcaleavey
7 - Meteor

Example I require 178 rows to total up to 9280 (however this may change ie 200 rows to total up to 10,000 or 152 to total up to 8,826).

 

I am trying to build 'dummy transaction data' that meets requirements similar to the above question. 

 

These rows cannot be the same i.e 9280/178 = 52.13 therefore every row would be 52.13 

No rows can be 0.

 

Ideally the rows will contain whole numbers or be rounded to 2 decimal places i.e. 10 or 10.12

 

I tried an Macro similar to the one found on the link below but this is taking to long, can it be done without a macro?. 

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/random-numbers-which-should-sum-up-to-...

 

Excuse me if this is a simple problem however I am new to alteryx and am unsure how to figure this out.

 

Thank you in advance.

10 REPLIES 10
danilang
19 - Altair
19 - Altair

Hi @DAStudent123@gmcaleavey 

 

Since both of you have the same, rather specific, problem, I'm going to hazard a guess that this some kind of assignment.  If that's the case, you should take the workflow that I've given you, which a very good start and do some work, together or on your own, to figure out the rest. 

 

The tip I will give you is that 178 records is a lot to navigate through.  Start off with a smaller problem say 6 records adding up to 40.  A smaller data set will make it easier for you both to see what is happening at each step of the process

 

Dan

Labels
Top Solution Authors