Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Batch Macro Parse Error

EileenTX
6 - Meteoroid

I ran the workflow and received an error in macro. The data types have been changed in a select tool in the macro. I even manually checked the files to make sure the data types are correct in the input folder. the macro is working using the last month files but got the error using this month data. The files are in xsl format. Not sure if the issues with the new files and the folder. I have seen someone changed the setting to make macro compatibility with the main workflow before, but do not remember where to make the changes. Maybe there are other things I need to do to fix the issues. I appreciate if anyone could help. 

EileenTX_0-1649436950848.png

 

3 REPLIES 3
TheOC
15 - Aurora
15 - Aurora

hey @EileenTX 

The error suggests that you are doing a numeric formula on a string field. If it works the first time, then i would imagine that the file you are using to build it has the fields as a numeric, and Its possible that on reading the next file, its changing the type to a string.

I would suggest forcing the field to be a numeric. You can do this using a select tool using the 'forced' setting:
https://help.alteryx.com/20214/designer/select-tool#:~:text=Use%20the%20%5Bdata%20type%5D%3A%20Force... 

Or, you can use tonumber([field]) in your formula.

https://help.alteryx.com/20214/designer/conversion-functions#:~:text=ToNumber(x%2C%20%5BbIgnoreError...

Both of these options will ensure the field is numeric for the formula.

 

Hope this helps, feel free to attach an example dataset with your macro, and i'd be happy to have a more in-depth look.

 

Cheers,
TheOC


Bulien
EileenTX
6 - Meteoroid

@TheOC 

Thanks for your prompt responses. As I mentioned in the post, I have used select tool to force the data type to the one I needed for certain columns. I have manually checked the input folders to make sure the columns are the correct data types. However I am still getting the same error. The message indicated the record #10 has an error, so I removed that file out of the folder and reran, then I got the same error indicating the error in record #9, if I remove the file again, it will show error record #8 . Where those files had no issues before. 

So I think it may have other issues that I did not identify. Maybe it's something related to the path or compatibility that can be changed in the user setting or advanced options? 

EileenTX
6 - Meteoroid

@TheOC I figured it out. I changed one data type from V-String to V_Wstring Forced, and changed the setting in the interface designer. The error messages are gone. I think because the files are in xls format and each file has slightly different format with different data type, the macro needs to be updated accordingly. 

Labels