Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Macro data types when passing to another macro ?

Alteryx Partner



I made a post over in the server area as I felt the overall discussion was more related to server than designer ( - would still love to get other views on the matter though)


In short I have a large workflow that has been broken into 6 workflows to be manageable .... I have now stitched these together using macros (see pic below)flow_as_macro.png


Now my question is I noticed that even though leaving the Macro output I have a select tool just before it which is defining the data types, lengths etc when the field is being ingested as an input to the subsequent macro all the data types are being set to variable width strings with  1073741823  length. To work around this I have placed a select tool before the macro output, saved the field config & then placed a select tool after the macro input on the next step and loaded this config to force the data into the way it should be.


Is this the correct / only approach or have I not configured something properly on the macro tools ?



Alteryx Certified Partner
Alteryx Certified Partner

Interesting and not an issue I have come across before.


I'm thinking that perhaps Alteryx takes the meta info from the 'macro input placeholder data'.


I would check what the datatypes and sizes are associated with the placeholder data and my guess is they are set to those large VWStrings you are seeing. 



Alteryx Partner

Thanks @BenMoss for your reply ..... In the macro input configuration I actually only defined the columns .... I didn't include any data ..... see picture below.


I take it from your response the correlation here is because I didn't put any data in place that it is then defaulting to these values.


If I do put sample data in I assume I would need to put data that will be to the extreme end of the schema otherwise wouldn't it be likely to truncate data ? e.g. if my sample for a field only has 10 chars but the incoming data schema is sizeable to 20chars will it truncate down to 10 or expand to cater ?


I assume this sample data is purely used to size/define the field i.e. it wouldn't enter into the dataset or anything like that ?




In my experience, when you create a column say ID and Value in Std Marco(Text Input), then typically Alteryx is able to differentiate the Column datatype based on default values provided in Marco Input tool.


However, pls note this behavior, if you provide ID:ABC123 and Value:10, then it assigns ID with String(Size 6) and Value(Byte(Size 1). ID: A then String(1) and Value: 12.5(Double 8) and Value: 123(Int 16) and so on.


In my opinion, there are 3 ways to address this:

1st - Leave the Macro column values blank and place a Select tool next to Macro Input and adjust the datatype and length based on the actual field values looking at the source.

2nd - copy an actual source column values to Macro text input fields, by this Alteryx automatically detects the datatype and length based on the default value provided.

3rd - even if you dont provide any default values in the Macro, the workflow would still work fine. Better not to take strain in deciding on the Macro input fields datatype and length.


In my opinion, I chose option 3 and won't worry about the default values and the datatype of the Text Input fields in Macro, Alteryx will take of this during run-time perfectly.