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.

Need Help Optimizing Claim-to-Accrual Allocation Logic (Batch Macro Too Slow on Server)

joemeek
5 - Atom

Hi everyone,

I’m working on automating a claim allocation process in Alteryx and am hitting performance issues that I’d love some help with.

 

My workflow matches claims to accruals from a subledger. I already have logic upstream that identifies matching pairs. My challenge is efficiently applying the claim amounts against the matched accruals while observing a few key constraints.

 

Allocation Rules:

  1. A claim can be split across multiple accruals, but the total allocation must not exceed the claim amount.

  2. An accrual can be used by multiple claims, but total allocations must not exceed the accrual amount.

So far, I’ve built a batch macro that:

  • Iterates over each claim individually.

  • Reads in the subledger file.

  • Applies allocations across eligible accruals until the claim is fully allocated.

  • Writes back the updated subledger for the next iteration.

While this approach works correctly on Desktop, it performs very poorly on Server due to 300+ file read/write operations. 

 

If I were doing this in Python, I’d simply load the subledger into memory once, update it during the loop, and export the final result after all claims are processed. However, my company does not allow the Python tool to be used on the server. Is there a way in Alteryx to simulate this kind of in-memory processing; i.e., updating a dataset across macro iterations without repeatedly writing to disk?


**Some Additional Context on what is happening up/downstream of this allocation**

Currently, the batch macro is configured with the following: 
1. Macro input that brings in the claims to be matched
2. Normal input tool that brings in the subledger. This way, it reads the updated subledger for each new iteration.
3. These inputs are joined on the Reseller (1 in the sample) and the program

4. Claims are allocated to accruals
5. Final allocated matches are output via macro output tool

6. Subledger is written to disk via normal output tool. This way, it is updated after each iteration. 

Thanks in advance!

2 REPLIES 2
apathetichell
20 - Arcturus

It's hard to believe it - but something seems a bit off because in an Alteryx workflow all processing is done in memory---- so unless you are reading in your file during each go through the iterative macro --- you shouldn't face these issues. You can pass in a static input to your iterative macro via a macro input --- and it should stay in memory.

joemeek
5 - Atom

My issue is that I need to update the subledger after each run through the batch macro, and the next iteration should reference the updated subledger so that it isn't allocated too many claims. I'm not aware of how to import the source file just once and iteratively update it without writing. Can you provide an example? 

Labels
Top Solution Authors