Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

D toc
Excerpt

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:

Code Block
aaa.bbb.ccc.ddd

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

Info

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.

D s
snippetBasic

Numeric literal example:

D code

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

Output: Generates a column containing the integer value 16909060.

Column reference example:

D code

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. 

D s
snippetSyntax

D code

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

D s lang notes

column_ipaddr

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

  • Missing input values generate missing results.
  • Multiple columns and wildcards are not supported.

D s
snippetusage

 

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

D s
snippetExamples

Example - Convert IP addresses to integers

Include Page
EXAMPLE - IPTOINT Function
EXAMPLE - IPTOINT Function

D s also
labelother