Working with Data Types


Envision supports string, date/datetime, number, and Boolean data types. These data types are automatically handled in the proper fashion. However, if you create calculated fields of your own, you need to be aware of how to use and combine the different data types in formulas.

For example, you cannot add a string to a number. Also, many functions that are available to you when you define a calculation only work when they are applied to specific data types. For example, the DATEPART() function can accept only a date/datetime data type as an argument.

The following section describes the various data types used by Envision.

String

Represents a sequence of zero or more characters. For example, "Phoenix", "ID-44400", and "Albert Einstein" are all strings. Strings are recognized by single or double quotes. The quote character itself can be included in a string by repeating it. For example, ‘O''Hanrahan’.

Date/Datetime

Represents a date or a datetime. For example "January 26, 1976" or "January 26, 1976 12:32:00 AM". If you would like a date written in long-hand style to be interpreted as a date/datetime, place the # sign on either side of it. For instance, “January 26, 1976” is treated as a string data type but #January 26, 1976# is treated as a date/datetime data type.

Number

Numerical values in Envision can be either integers or floating-point numbers.

With floating-point numbers, results of some aggregations may not always be exactly as expected. For example, you may find that the SUM function returns a value such as -1.42e-14 for a column of numbers that you know should sum to exactly 0. You can eliminate this potential distraction by using the ROUND function.

Operations that test floating point values for equality can behave unpredictably for the same reason. Such comparisons can occur when using level of detail expressions as dimensions, in categorical filtering, creating ad-hoc groups, creating IN/OUT sets, and with data blending.