Dear Community,
is there a way to implement a function and then feed different variables to the function? I implemented simple macro (standard, iterative and batch) before, yet I can't figure out the following workflow.
The two chunk workflows are the same, except each is based on individual column. The green comments aim to showcase how the corresponding tool is related to this column. The same calculation applies to column B, C, D etc. It is possible to implement sth such as in Python:
I've tried with batch macro and use the column names as control parameters. Yet no success. Pain points: The first Summarize Tool calculates the median based on this column. Then the median value is used for further calculation. Also for the Multi-Field Binning Tool, even connected with a Control Parameter. Still one error message: at least one field must be selected.
I'm afraid that I can't upload the dataset due to privacy. If my explanation is not enough, I'll see if I could mock a dataset. Otherwise, I appreciate your insight! Many thanks!
Solved! Go to Solution.
Can you give an example of what a function would be and how you would want to change the variables within that function?
Hi @jhe1
I understood what you are trying to do, but i dont think that building a macro to run each time with different columns of the same dataset is a good idea. They usually work good with the same columns and different rows.
But if you really want to go ahead, you could use the field info to get the field names,put a index on the fields that gonna be imported by each iteraction, rename then before of the macro to a standard name, and rename then to the original name after the macro. Too much work i think.
Hi KSowers,
thank you for your comment. I was on vacation over the past week. So just got time to reply now.
For the function, I mean to put the calculation process in one function with column name as the argument. Then call the function by passing each column name.
Hi Felipe_Ribeir0,
many thanks for your reply. Yes, you correctly understood what I meant. Thank you!
I implemented the process with Python. However, I found your explanation why macro is not a good idea for this case excellent! I think your suggestion should be a potential solution in this case.
Best,
Jing