General Usage Data Type Expressions

The following data types (dytpes) are available through Analyze to support your requirements

There are a wide variety of standard data types (dtypes) to support your requirements. As datasets become larger, determining smaller size dtypes for value storage can shrink the size of the table and improve performance. The following dtypes are available:

  • Boolean
  • Text
  • Numbers
    • SmallFloat (6 Digits)
    • Float (15 Digits)
    • BigFloat
    • SmallInteger (16 bit) (-32768 to 32767)
    • Integer (32 bit) (-2147483648 to 2147483647)
    • BigInteger (64 bit) (-9223372036854775808 to 9223372036854775807)
    • Numeric
  • Dates and Times
    • Date
    • Timestamp
    • Time Interval

You can convert from one dtype to another using the func.cast() process.

func.cast() type conversions

Analyze ExpressionDescriptionResult
func.cast(123, Text)Integer to Text‘123’
func.cast(‘123’, Integer)Text to Integer123
func.cast(‘78.69’, Float)Text to Float78.69
func.cast(‘78.69’, SmallFloat)Text to Small Float78.69
func.cast(‘78.69’, Integer)Text to Integer (Truncate decimals)78
func.cast(‘78.69’, SmallInteger)Text to Small Integer (Truncate decimals)78
func.cast(‘78.69’, BigInteger)Text to Big Integer (Truncate decimals)78
func.cast(1, Boolean)Integer to BooleanTrue Data Type Conversions

Analyze ExpressionReturn TypeDescriptionExample
func.to_char(timestamp, text)textconvert time stamp to text stringto_char(current_timestamp, ‘HH12:MI:S S’)
func.to_char(interval, text)textconvert interval to stringto_char(interval ‘15h 2m 12s’, ‘HH24:MI:S S’)
func.to_char(integer, text)textconvert integer to stringto_char(125, ‘999’)
func.to_char(bigfloat, text)textconvert real/double precision to stringto_char(125.8::real, ‘999D9’)
func.to_char(numeric, text)textconvert numeric to stringto_char(-125.8, ‘999D99S’)
func.to_date(text, text)dateconvert string to datefunc.to_date(table.Created_on, 'DD-MM-YYYY')
func.to_number(text, text)numericconvert string to numericto_number (‘12,454.8 -‘, ‘99G999D9S ‘)
func.to_timestamp(text, text)timestamp with time zoneconvert string to time stampto_timestamp(‘05 Dec 2000’, ‘DD Mon YYYY’)
func.to_timestamp(bigfloat)timestamp with time zoneconvert UNIX epoch to time stampto_timestamp(200120400)
Last modified November 27, 2023 at 12:56 PM EST: Restructured the file structure/a few changes (f6c58b8)