QQ - How do I cast between different data types?
- 2 Minutes to read
- Print
- DarkLight
- PDF
QQ - How do I cast between different data types?
- 2 Minutes to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Article In Progress...
In general data should be loaded into a system so that field-data types are well matched, but this is not always possible. The following functional areas may require field-data types to be changed:
- Joins - there are limitations around which kind of continuous fields can be joined together - generally field-data types need to match exactly when linking continuous data-types.
- Profiles - continuous fields cannot be profiled
- Context Panel - quick counts are not displayed for continuous fields
- Functions - some functions only accept a particular field-data type
The following functional areas support casting of data types:
- String Functions: LCAST, DCAST, ICAST, WILDICAST, WILDDCAST, CTOD, CONCAT
- LMath: A (Convert Double to Int)
- DMath: A (Convert Int to Double)
- Expression Builder: Explicitly set Target Datatype
String
From | To | Details |
---|---|---|
STRING DISCRETE | STRING DISCRETE |
|
STRING DISCRETE | STRING CONTINUOUS |
|
STRING DISCRETE | INTEGER DISCRETE |
|
STRING DISCRETE | INTEGER CONTINUOUS |
|
STRING DISCRETE | DOUBLE DISCRETE |
|
STRING DISCRETE | DOUBLE CONTINUOUS |
|
STRING DISCRETE | DATE |
|
STRING DISCRETE | DATETIME | |
STRING DISCRETE | LONGINTEGER DISCRETE |
|
STRING DISCRETE | LONGINTEGER CONTINUOUS |
|
STRING CONTINUOUS | STRING DISCRETE | May not be possible, depending on cardinality of the source field. To find the number of discrete values, use Field Audit or Data Audit
|
STRING CONTINUOUS | STRING CONTINUOUS |
|
STRING CONTINUOUS | INTEGER DISCRETE |
|
STRING CONTINUOUS | INTEGER CONTINUOUS |
|
STRING CONTINUOUS | DOUBLE DISCRETE |
|
STRING CONTINUOUS | DOUBLE CONTINUOUS |
|
STRING CONTINUOUS | LONGINTEGER DISCRETE |
|
STRING CONTINUOUS | LONGINTEGER CONTINUOUS |
|
STRING CONTINUOUS | DATE |
|
STRING CONTINUOUS | DATETIME |
Integer
From | To | Details |
---|---|---|
INTEGER DISCRETE | INTEGER CONTINUOUS |
|
INTEGER DISCRETE | STRING DISCRETE |
|
INTEGER DISCRETE | STRING CONTINUOUS |
|
INTEGER DISCRETE | DOUBLE DISCRETE |
|
INTEGER DISCRETE | DOUBLE CONTINUOUS |
|
INTEGER DISCRETE | LONGINTEGER DISCRETE | |
INTEGER DISCRETE | LONGINTEGER CONTINUOUS | |
INTEGER DISCRETE | DATE / DATETIME | NA |
INTEGER CONTINUOUS | INTEGER DISCRETE | |
INTEGER CONTINUOUS | STRING DISCRETE | |
INTEGER CONTINUOUS | STRING CONTINUOUS | |
INTEGER CONTINUOUS | DOUBLE DISCRETE | |
INTEGER CONTINUOUS | DOUBLE CONTINUOUS | |
INTEGER CONTINUOUS | DATE / DATETIME | NA |
LongInteger
From | To | Details |
---|---|---|
LONGINTEGER DISCRETE | INTEGER CONTINUOUS |
|
LONGINTEGER DISCRETE | STRING DISCRETE |
|
LONGINTEGER DISCRETE | STRING CONTINUOUS |
|
LONGINTEGER DISCRETE | DOUBLE DISCRETE |
|
LONGINTEGER DISCRETE | DOUBLE CONTINUOUS |
|
LONGINTEGER DISCRETE | INTEGER DISCRETE | |
LONGINTEGER DISCRETE | INTEGER CONTINUOUS | |
LONGINTEGER DISCRETE | DATE / DATETIME | NA |
LONGINTEGER CONTINUOUS | INTEGER DISCRETE | |
LONGINTEGER CONTINUOUS | INTEGER CONTINUOUS | |
LONGINTEGER CONTINUOUS | STRING DISCRETE | |
LONGINTEGER CONTINUOUS | STRING CONTINUOUS | |
LONGINTEGER CONTINUOUS | DOUBLE DISCRETE | |
LONGINTEGER CONTINUOUS | DOUBLE CONTINUOUS | |
LONGINTEGER CONTINUOUS | DATE / DATETIME | NA |
Double
From | To | Details |
---|---|---|
DOUBLE DISCRETE | DOUBLE CONTINUOUS | |
DOUBLE DISCRETE | STRING DISCRETE | |
DOUBLE DISCRETE | STRING CONTINUOUS | |
DOUBLE DISCRETE | INTEGER DISCRETE | |
DOUBLE DISCRETE | INTEGER CONTINUOUS | |
DOUBLE DISCRETE | LONGINTEGER DISCRETE | |
DOUBLE DISCRETE | LONGINTEGER CONTINUOUS | |
DOUBLE DISCRETE | DATE | |
DOUBLE DISCRETE | DATETIME | |
DOUBLE CONTINUOUS | DOUBLE DISCRETE | |
DOUBLE CONTINUOUS | STRING DISCRETE | |
DOUBLE CONTINUOUS | STRING CONTINUOUS | |
DOUBLE CONTINUOUS | INTEGER DISCRETE | |
DOUBLE CONTINUOUS | INTEGER CONTINUOUS |
|
DOUBLE CONTINUOUS | LONGINTEGER DISCRETE | |
DOUBLE CONTINUOUS | LONGINTEGER CONTINUOUS | |
DOUBLE CONTINUOUS | DATE | |
DOUBLE CONTINUOUS | DATETIME |
Date and Datetime
From | To | Details |
---|---|---|
DATE | DATETIME | |
DATETIME | DATE | |
DATE | STRING DISCRETE | |
DATE | STRING CONTINUOUS | |
DATETIME | STRING DISCRETE | |
DATETIME | STRING CONTINUOUS | |
STRING DISCRETE | DATE | |
STRING CONTINUOUS | DATE | |
STRING DISCRETE | DATETIME | |
STRING CONTINUOUS | DATETIME |
Was this article helpful?