Page tree

 

Support | BlogContact Us | 844.332.2821

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r0411

D toc

 

Excerpt

Computes a four-octet internet protocol (IP) address from a 32-bit integer input.

...

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

So, the formula to compute this IP address is the following:

Inputaaabbbcccddd
X

aaa = floor(Input / (256 3 ))

remainderA = Input - aaa

bbb = floor(remainderA / (256 2 ))

remainderB = remainderA - bbb

ccc = floor(remainderB / 256)

remainderC = remainderB - ccc

ddd = remainderC

...

Output: Generates a column containing the IP address 1.2.3.4

Column reference example:

D code

derive value: IPFROMINT(IpInt) as: 'ip_addr'

...

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

D s
snippetusage

 

Required?Data TypeExample Value
YesInteger literal or column reference16909060

D s
snippetExamples

Example - Convert IP addresses to integers

...