This scenario involves selecting Excel files in a folder based on their cumulative sum, ensuring the sum reaches a given Amount without exceeding it. Alteryx should dynamically pick files until the difference between the sum of selected files and the target Amount reaches zero.
Scenario Breakdown
- Input: A folder with multiple Excel files, each containing an Amount value.
- Target Condition: Select files sequentially until the sum matches the given Amount exactly.
- Stopping Condition: Stop selecting files once the cumulative sum equals the Amount.
Example 1 Given Amount: 100
File Name Amount
| File1 | 50 |
| File2 | 20 |
| File3 | 30 |
| File4 | 23 |
Step-by-Step Selection Process
- Select File1 → Cumulative Sum = 50 → Difference = 100 - 50 = 50
- Select File2 → Cumulative Sum = 50 + 20 = 70 → Difference = 100 - 70 = 30
- Select File3 → Cumulative Sum = 70 + 30 = 100 → Difference = 100 - 100 = 0 ✅ STOP
- File4 is not needed as the target is met.
Final Selected Files: File1, File2, File3