Computes an integer value for a four-octet internet protocol (IP) address. Source value must be a valid IP address or a column reference to IP addresses.

IP addresses must be in the following format:


where aaabbbccc, and ddd, are integers 0 - 255, inclusive.

NOTE: IPv6 addresses are not supported.

The formula used to compute the integer equivalent of the above IP address is the following:

(aaa * 2563) + (bbb * 2562) + (ccc * 256) + (ddd)

As a result, each valid IP address has a unique integer equivalent.

Numeric literal example:

derive type:single value: IPTOINT('' ) as:'myAddress'

Output: Generates a column containing the integer value 16909060.

Column reference example:

derive type:single value: IPTOINT(IpAddr) as: 'ip_as_int'

Output: Generates the new ip_as_int column containing the value of the IpAddr column converted to an integer value. 

derive type:single value: IPTOINT(column_ipaddr)

ArgumentRequired?Data TypeDescription
column_ipaddrYstringColumn name or string literal identifying the IP address to convert to an integer value


Name of the column or IP address literal whose values are used to compute the equivalent integer value.


Required?Data TypeExample Value
YesString literal or column reference (IP address)

Example - Convert IP addresses to integers