cancel
Showing results for
Did you mean:

# Custom Formula Functions

Community Content Engineer
Created on

This contribution is compiled entirely from @jdunkerley79's posts on adding Custom Formula Functions in our Community Discussion Boards...

"I have updated my Alteryx Formula AddIns based mainly around things I see coming up in the community and also things I find that should be easier. The full function list is at the bottom of this post.

Hopefully it will make creating some formulas easier!

James"

The full function list currently is:

• IfNull: If first value is null return second
• Coalesce: Given list of values return first non null value (C++)
• Modulo: General Double Based Modulo function
• HexBinX: Given an X,Y point and optional radius, get X co-ordinate of hexagonal bin’s centre
• HexBinY: Given an X,Y point and optional radius get Y co-ordinate of hexagonal bin’s centre
• Rand_Triangular: Given a uniform random number transform into a triangular distributed random
• Avg: Average of a list of values ignoring NULL
• Count: Count of a list of values ignoring NULL
• Sum: Sum of a list of values ignoring NULL
• MakeDate: Create a new date from Year, Month, Day
• MakeTime: Create a new time from Hour, Minute, Second
• MakeDateTime: Create a new DateTime from Year, Month, Day, Hour, Minute, Second
• ToDate: Truncate a DateTime to a Date
• ToDateTime: Appends midnight to a Date to create a DateTime
• Day: Get the day of the Month [1-31]
• Month: Gets the month number [1-12]
• Year: Gets the four digit year
• WeekDay: Gets the day of the week [Sunday (0) through to Saturday (6)]
• Quarter: Gets the quarter of the date [1-4]
• OrdinalDay: Gets the day of the year [1-366]
• WeekStart: Get first Sunday before or equal to date
• WeekEnd: Get first Saturday after or equal to date
• MonthStart: Get First Day of Month
• MonthEnd: Get Last Day of Month
• QuarterStart: Get First Day of Quarter
• QuarterEnd: Get Last Day of Quarter
• YearStart: Get First Day of Year
• YearEnd: Get Last Day of Year
• BusinessDays: Number of weekdays between two dates
• IsLeapYear: Is a year a leap year (takes a year not a date as an input use IsLearYear(Year([Date]))
• LeftPart: Gets the text before the first instance of a separator
• RightPart: Gets the text after the first instance of a separator
• Split: Splits a string into tokens and then returns the specified instance
• NormDist: Compute PDF or CDF on Normal distribution
• NormInv: Compute inverse CDF on Normal distribution
• LogNormDist: Compute PDF or CDF on Log Normal distribution
• LogNormInv: Compute inverse CDF on Log Normal distribution
• Deg: Convert radians to degrees

The installation process should be:

- Extract all the files in it to somewhere you want to keep and  run the tools from

- Run Install.bat within this folder (you may need to approve within Windows Defender SmartScreen as well)

- Accept the UAC request

- Reopen Alteryx and the tools should be available.

Asteroid

Hi Matt,

This is super cool. I download the files and followed your instruction. Unfortunately I was not able to install it after the command window showed up and I entered my computer credential. Please kindly advise anything I have done wrong. I really want to install them on my computer.

Thank you!

Meteoroid

This step is not working  "Run Install.bat within this folder (you may need to approve within Windows Defender SmartScreen as well)".

Command window closed right after showed up.

tried several times. all like that.

Cannot use those functions.

Meteoroid

This is awesome, ended up here searching for how to write custom functions. But looks you've made all the ones I was wanting.

It's still a bit of a pain though as need to install these on every users system if want to rerun analysis, makes the work not very transferable. These really should be standard in Alteryx already so don't have to worry about moving data.

Where can I start a petition?

Atom

Went through the installation process and verified installation into C:\Program Files\Alteryx\bin\RuntimeData\FormulaAddIn\, where I proceeded to use the split function in Alteryx and got an 'Unable to load dll: C:\Program Files\Alteryx\bin\RuntimeData\FormulaAddIn\JDFormulaAddIn.dll'.  Searching the community and the internet did not provide a reasoning why?  Any help?