Excerpt |
---|
Finds the host value from a valid URL. Input values must be of URL or String type and can be literals or column references. |
In this implementation, a host value includes everything from the end of the protocol identifier (if present) to the end of the extension (e.g.
.com
).
URL literal examples:
D code |
---|
derive type:single value: HOST('http://www.example.com' ) as: 'myHost' |
Output: Generates a column containing the value www.example.com
.
Column reference example:
D code |
---|
derive type:single value: HOST(myURLs) as: 'myHost' |
Output: Generates the new myHost column containing the host values extracted from the myURLs
column.
D code |
---|
derive type:single value: HOST(column_url) |
Argument | Required? | Data Type | Description |
---|
column_url | Y | string | Name of column or String or URL literal containing the host value to extract |
column_url
Name of the column or URL or String literal whose values are used to extract the host 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, Host, Subdomain, and Suffix functions
Include Page |
---|
| EXAMPLE - Domain Functions |
---|
| EXAMPLE - Domain Functions |
---|
|