This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
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)
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 ?
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.