Inspiration
During the Euleryx series hosted by @Pilsner , I encountered many challenges that required computing with BigInt (numbers exceeding 100 digits—something most built‑in functions struggle with).
Recently, seeing Pilsner using a custom IsPrime function created by @gawa to speed up runtime motivated me to explore building my own custom functions for handling BigInt.
The Functions
To support large‑number computations inside Alteryx, I developed a set of custom BigInt functions that return results as strings:
- BigInt_Add(a, b)
- BigInt_Sub(a, b)
- BigInt_Mul(a, b)
- BigInt_Div(a, b)
- BigInt_Mod(a, b)
- BigInt_Pow(a, b)
I’ve attached the .xml and .dll files below. you can add these file to the location mention in Alteryx Help
WARNING: Only Tested in a simple workflow, PLEASE TEST before use in PRODUCTION workflow
Below is my journey to build these custom function:
First Attempt: Duplication
My initial approach followed two key resources:
- Alteryx Help
- Creating an Alteryx Custom Function in C++
I installed Visual Studio, configured the environment, copied example code, and compiled the DLL and XML files.
But it didn’t work.
After trial and error, I discovered the issue, I forgot to delete some unused header .h and source code.cpp files, which caused conflicts during compilation.
Lesson learned.
Trying to Create My Own Function
Although I had experience with Go and Python, I was new to C++.
I only watched a few TikTok videos about C++, which surprisingly helped later.
I only option is to create BigInt function with the help of AI. Start with BigInt_Add
But it didn’t work.
Since I had no idea at all, I decided to implement IsPrime from scratch, because the function is smaller and simpler.
Duplicate Creation, Now With Understanding
This time, I could finally follow the flow of the code and begin to understand how everything worked under the hood.
The good news? I started seeing different errors—this time without any Alteryx error messages.
That was a positive sign. It meant the function was compiling correctly, just the function is tell Alteryx the result is error.
After going back to both article and reading them more carefully, I uncovered the key detail I had missed earlier.
In normal C/C++:
- 0 = success
- non-zero = error
In Alteryx custom functions:
AI-generated code followed standard C++ conventions, which caused Alteryx to treat valid results as error.
After reversing the return values, It worked perfectly.
Testing the BigInt Functions
With the return values fixed, I applied the same change to my BigInt functions.
They worked inside the Formula tool. Time to stress-test with something heavy: Fibonacci(1000).
Using BigInt_Add in a Multi‑Row formula:
IF [RowCount] <= 2 THEN
"1"
ELSE
BigInt_Add([Row-1:fib], [Row-2:fib])
ENDIF
But I got an error, with no error message again, test with the IsPrime function produced similar issues.
And using hard code value, both work fine.
So the only reason I can test think of is NULL or empty inputs.
Requesting AI to accept the Null or Empty Inputs. and Bingo, problem solved.
Final CreationWith this working structure, I asked AI to help generate the remaining functions:
- Subtraction
- Multiplication
- Division
- Modulo
- Power
All of them now run correctly in both Formula and Multi-Row tools.
ConclusionBuilding custom BigInt functions for Alteryx was a challenging but rewarding experience, especially for someone new to C++. The process helped me understand the Alteryx SDK, C++ return conventions, and the importance of handling NULL inputs.
I hope it help you to build your own custom function. Join us in Eulteryx.