Alteryx Designer Desktop Discussions

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

Dynamically create batch groups based on a grouping id not exceeding a count threshhold

matthewsuarez
5 - Atom

Hello,

 

So I have about 88k records I'm trying to send to Salesforce to update as apart of an automated load. The output tool will update records in about a 10k batch size. The problem is those 88k records are child records associated with a parent object in salesforce and if one parent has multiple child objects that are trying to be updated at the same time across different batches, the load will fail. It will generate an 'unable to obtain exclusive access' error.

 

Basically I have to ensure that all of one particular parent records 'children' in the load will fall into the same batch.

 

For the sake of a simple example, lets say I'm dealing with 10 records and the batch size is 3. 

Desired output contains the "batch" column that would never have more than 3 records and no parent ID would ever cross between batches. 

Child ID | Parent ID | Batch

1              1                1

2              1                1

3              1                1

4              2                2

5              2                2

6              3                3

7              3                3     

8              4                3

9              5                4

10            6                4

 

So like when Batch 2 becomes Batch 3, it stops at 2 because in order to add Parent ID 3 it would go past the threshhold limit of 3 and instead becomes batch number 3.

 

Hopefully that makes sense - but also if anyone has dealt with this salesforce issue in other ways, maybe there is a better solution.

 

1 REPLY 1
FinnCharlton
13 - Pulsar

Hi @matthewsuarez , here's how you can do this using the multi-row formula tool:

 

image.png

 

Hope it helps!

Labels