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

Finds the value a subdomain value from a valid URL. Input values must be of URL or String type.

In this implementation, a subdomain value is the first group of characters in the URL after any protocol identifiers ( http:// or https://, for example).

D s
snippetBasic

URL literal example:

D code

derive type:single value: SUBDOMAIN('http://www.example.com' ) as: 'myDomain'

Output: Generates a column containing the value www

D code

derive type:single value: SUBDOMAIN('http://www.exampl.e.com') as: 'myDomain'

Output: Generates a column containing the value www.exampl

Column reference example:

D code

derive type:single value: SUBDOMAIN(myURLs) as: 'myDomain'

Output: Generates the new myDomain column containing the subdomain values extracted from the myURLs column. 

D s
snippetSyntax

D code

derive type:single value: SUBDOMAIN(column_url)

ArgumentRequired?Data TypeDescription
column_urlYstringName of column or String or URL literal containing the sub-domain value to extract

D s lang notes

column_url

Name of the column or URL or String literal whose values are used to extract the subdomain 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 (URL)http://www.example.com

D s
snippetExamples

Example - Domain, Subdomain, Host, and Suffix functions

Include Page
EXAMPLE - Domain Functions
EXAMPLE - Domain Functions

D s also
labelother