I've been working on optimizing an existing Alteryx workflow. Previously, this workflow utilized 6 separate Python tools for certain calculations. To improve performance and streamline the process, I've refactored the workflow, replacing the Python code with native Alteryx tools wherever possible.
The challenge I'm facing is that after this refactoring, I'm observing a consistent, albeit small, discrepancy in the "minute decimal" values between the original (Python-based) workflow and the new (Alteryx tool-based) workflow. This difference specifically appears in one particular calculated column.
Crucially, the formula used for this calculation is identical in both workflows. The only difference lies in how that formula is implemented:
Original Workflow: Python script performing the calculation.
New Workflow: A combination of Alteryx tools
Any suggestions on how to further debug this or identify the exact point where the discrepancy is introduced within the Alteryx tool chain?
I am happy to provide:
A simplified version of the calculation formula.
Screenshots of the relevant Alteryx workflow sections.
Example input and output data (anonymized if necessary) showing the discrepancy.(I will be attaching this now)(One column is of python workflow and the other column data is of alteryx. They are dummy data resembling the issue)
Thank you in advance for your time and expertise!
Best regards,
Akhilesh
The major reason would be the way these two technologies use data type for calculations.
Alteryx uses Double type (this is irrespective of the type you have selected in select tool) and python uses float.
Even the rounding method can affect the values.
Check the level of precision you have in decimal places in values.
Can you confirm the libraries used in the python and if you rounded values anywhere in python and Alteryx?
Some how Alteryx is rounding the numbers a bit differently, we had the same issue comparing Alteryx to excel. It can be due to data type. Let say the original data type is Double and somewhere along the workflow you changed it to 2 decimals, from that point each new calculation will create a deviation from the original. Same thing can happen in Python, how it was coded, keeping 2 decimals or have a float number.
Review the 2 workflows to see if any of the data types is been change a long the automation.
Hi thanks for the response!
Numpy,pandas and re libraries are used on python
It is not how the formula is set, but the data type. What is the data type in Alteryx for the fields var-a. var-b and var-x?
If your issue is with precise data 10+ decimals --- I faced this issue ---> I ended up converting my python number to a string and sent it to Alteryx as a string ---> Once there I could convert to fixed decimal at whatever precision I needed. My memory -- and this was a few years and a few versions of python ago was that at it's core there was a limit to the precision that was passed between Python and Alteryx --- like 8 or 10 decimals.
Correct, and adding to that, if you need higher precision in python, you would need to use decimal module instead. That will give you higher decimal precision and you should get same results. Unless it’s manually rounded at some point.
Also, check for the rounding, in python, rounding is to even number. What that means is if you round 3.445 in python, it will round it to 3.44, but that will be converting to 3.45 in alteryx.
