HI Team,
I have the below requirement. I need split rows into multiple output based values of a column. I want to split based on values in Entity column. But I do not want to use the filter tool. Is there any other alternative.
Appreciate any help around this.
Input:
Entity | Value |
A | 1111 |
A | 2222 |
B | 3333 |
B | 4444 |
B | 5555 |
C | 6666 |
C | 7777 |
C | 8888 |
3 Outputs :
Entity | Value |
A | 1111 |
A | 2222 |
B | 3333 |
B | 4444 |
B | 5555 |
C | 6666 |
C | 7777 |
C | 8888 |
I do not want to use filter because the filter values in Entity column might change so do not want to hard code it.
Solved! Go to Solution.
You could use a Batch Macro to cycle through the Entity list.
hi @hemant86 This is one way by using Python tool. Python tool allows max 5 outputs so that is the limit of # of unique value of 'Entity'.
Thanks @gawa . This is great. But I will be needing output more than 5 as well.
What are you trying to do with the data? If you can tell the story, we can give better suggestions - I believe the batch macro can package the calculations and ETL logic you need + can go through each entity as shown above. Unless each entity has a different calculation... in which case your ETL will need to be dynamic.
Hi @caltang All the calculation are being taken care before filtering the data based on entity. I'm just trying to produce separate output file filtering the data based on entity. This is the final step in workflow.
@hemant86 If you want to output to separate file based on value of Entity, use option "Take File/Table Name From Field" in Output tool. You can change filename in Formula tool based on your criteria.
Or, as @caltang said, Batch Macro is also good option to be considered. It totally depends on what you want to do.
@hemant86
What do you mean by "Output"?
If you are going to output to Excel files, we can provide the fullpath for each row, then use the option in Excel out "Take File/Table Name from Field".
User | Count |
---|---|
52 | |
27 | |
25 | |
24 | |
21 |