I've made a workflow that takes each individual customer through a filter and outputs a report associated to that person using Basic Table, Report Text, Layout, and Render.
Name | Spend | Count | Score |
Adam | $100 | 1 | 5 |
Beatrice | $0 | 3 | 0 |
Charlie | $50 | 5 | 1 |
Deli | $10 | 3 | 1 |
For example, when I filter out Adam into two separate tables, it would look like so rendered (Report 1):
Transactions
Description | Transactions |
Name | Adam |
Spend | $100 |
Count | 1 |
Score
Description | Scoring |
Name | Adam |
Score | 5 |
Now I want to output all 4 customers at once, where each customer has its own record. But I'm unable to separate the entries so that all of Adam's transactions are outputted first in Record 1, and then Beatrice in Record 2 below all of Adam's data, and so on. It looks like this right now but I want each customer to have its own Record (Report 2):
Description | Transactions |
Name | Adam |
Spend | $100 |
Count | 1 |
Name | Beatrice |
Spend | $0 |
Count | 3 |
Name | Charlie |
Spend | $50 |
Count | 5 |
Name | Deli |
Spend | $10 |
Count | 3 |
Description | Scoring |
Name | Adam |
Score | 5 |
Name | Beatrice |
Score | 0 |
Name | Charlie |
Score | 1 |
Name | Deli |
Score | 1 |
How can I change my workflow so that they are all separated when I render after Layout like Report 1 but each different customer appearing after all of the previous one's data is outputted?
Thanks :)
Solved! Go to Solution.
The good thing is that you build the WF that do the job, what is missing here is a batch macro, so just copy the whole WF to another Canvas and then Convert the Input data tool to a Macro Input tool. Now embed the person name in the file name or as a sheet name, so Alteryx will create or separate file for each name or will create a new tab for each name.
Add a Filter tool just after the Macro input Tool and connect the Control Parameter tool to the Filter Tool Q to Q
Set the Formula [Name]=[1]
And save
Now go back to the original WF, delete everything except the Data input tool.
Click on Insert>Macro
Connect this tool one time to the Control Parameter anchor and to the data anchor.
Click on the macro and select in Questions [Name]
Now you WF will work in the Batch macro each time processing one name at a time
As above. If you want each person on a separate report, then Render inside the macro, otherwise if you want them all on one report then render outside the macro. You will see the layout that the Batch Macro advised above will generate for each person and then you can arrange them. The method @OTrieger has described will be the quickest conversion from where you are.
The way that I would do this otherwise, would be to have another field that designates who the record belongs to. So, columns being Description; Transaction; Name; and then select the name as a grouping variable on the Table tool. No need for a macro then.