Hello,
I read data from an excel file whose file structure is as below. It has GroupId, company_name and lot of other columns. The logic is to find unique company names, get all groupid's and apply certain process. The processes is same for different companies. 1 company can have multiple group id's. So the workflow has to iterate through distinct companies.
For e.g.
for Comp_1 --> 1,2,5 [ group id's ]
Comp_2 --> 3,7,8 [ group id's ]
Does this need a iterative macro if so are there any examples,
GroupId | Company_Name | Col3 | Col4 |
1 | Comp_1 | asas | asas |
2 | Comp_1 | asdasd | asdasd |
3 | Comp_2 | asdio | asasd |
4 | Comp_3 | askdjas | asdasd |
5 | Comp_1 | asdas | asas |
6 | Comp_4 | sdasd | asdas |
7 | Comp_2 | asdas | asda |
8 | Comp_2 | asdas | asdasd |
I tried writing a macro to update the Company Name but not seem to be working. Any help is appreciated.
THanks
Solved! Go to Solution.
Sometimes an Iterative macro is required to solve a problem like this, but other times you can do it with a Batch macro as you have done.
Have you configured the Macro tool in your workflow that calls your macro to Group By your Company_Name field? This may be what you're missing.
For example. Once you have configured your Control Parameter setting in the Questions Tab, you need to click on the Group By tab and configure it accordingly.
I hope this helps.
Hi @amrutkasyap
Macros add an extra level of complexity to any process and before you build one, try and see if the existing process can be made to apply to all companies at once. You can try adding the company name as a group by field in Sort, Sample, Multirow, Transpose, Crosstab and other tools. For any joins, add the company name as an additional join field.
The simple sample below calculates the percentage of total sales for each company that each group generates.
If, after this analysis, you feel that you still require a macro, then remember that the action tools only work when the macro is called by an external workflow. Inside the macro, the filter tool will always use the value that is set set in configuration window.
Dan
Thanks this approach worked..