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).
URL literal example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value: subdomain('http://www.example.com' ) as: 'myDomain' |
---|
|
subdomain('http://www.example.com') |
Output: Returns the value: www
.
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value: subdomain('http://www.exampl.e.com') as: 'myDomain' |
---|
|
subdomain('http://www.exampl.e.com') |
Output: Returns the value: www.exampl
.
Column reference example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value: subdomain(myURLs) as: 'myDomain' |
---|
|
subdomain(myURLs) |
Output: Returns the subdomain values extracted from the myURLs
column.
D lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value: subdomain(column_url) |
---|
|
subdomain(column_url) |
Argument | Required? | Data Type | Description |
---|
column_url | Y | string | Name of column or String or URL literal containing the sub-domain value to extract |
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.
Required? | Data Type | Example Value |
---|
Yes | String literal or column reference (URL) | http://www.example.com |
Example - Domain, Subdomain, Host, and Suffix functions
Include Page |
---|
| EXAMPLE - Domain Functions |
---|
| EXAMPLE - Domain Functions |
---|
|