Hi there! I'm fairly new to Alteryx and I'm developing a simple macro that add descriptions to several different codes.
I'm trying to set it up in the simplest way possible and the only thing I'm missing on my workflow is how to get the column name of the parameter in order to filter my table with codes
I would like the condition on the left to be able to test the column name of the workflow that calls the macro, however I see that I'm only comparing it with it's values (12, 03, 05, etc)
is there any way to fix this? or do I need to create a new control parameter to get that column name separately?
I'd greatly appreciate some help, thank you!
Hello @francoollino,
If the name of the column is going to switch from time to time you would need in fact to pass the column name too.
Could you create some dummy data for me to see if there is a simpler solution? You might be able to make this possible with the dynamic input tool.
Regards
Hi there! thank you for the quick response, sure. So let's say this is the workflow that calls my macro:
and as you can see, column 4 name "ENHANCED_AACT_STATUS_CD" represents the type of code I'm looking to add the description so it should act as a filter to my Macro but like I already mentioned, the way I have it right now I can only access the values ('12', '03' and '20')
That column name can have several options and I'm trying to hard code them on my macro to have just one and have it able to do them all
thank youuu
@francoollino you mention that you are trying to add a description, but i don't see where that is occurring in this macro. If you are looking for a dynamic way to tell the macro to add a description, i would suggest transposing the selected fields, using the field name and code as fields which you can then join to a list of all possible fields/codes that exist in your universe. I just don't see the use for the control parameter from what the image shows, but i might be off a bit on the usage.
thanks for helping! the macro is attaching the description column at the end but it's not shown entirely on the first picture I attached
the workaround you mention sounds good but I was looking to avoid that as this macro will get used by a big team and the intention was to make it work only based on the column name, but it seems that it is not possible so I might just have to implement what you're suggesting 😞
So, you are trying to force the macro into a single-field update is that correct?
You could still do that without transposing by having a join updated by an action and the entire list of code descriptions on the right side of the join (even with a filter if you wanted to speed it up a bit - Find/Replace if they are all text-based codes to really speed things up)
The benefit to the transpose method is that it's really flexible with what fields are passed through. The downside hits when there are a ton of rows if you are working with smaller spec'd machines as it can use up a lot of memory.
I think I did not express myself right. I absolutely need that column name because it tells me which category of code I'm adding the description to, without it I have several '14' codes for example.
I was wondering if the macro can read the column name from the workflow without having it as a separate control parameter, that way I use it to filter my table and get the appropriate code description appended.
Thanks for the reply! It would work but you are avoiding the issue I'm facing of not having the column name on the macro, on your attached file you already had "Code_ABCD" set as fixed for the column name, and on my situation that name is dynamic and I don't know how to easily give it to the macro to make the filter.
I guess i don't understand the need for the filter. are you saying the name of the field coming in isn't the same name on the description lookup table?