🎓
Models University
  • Alpha Testing
    • 👋Welcome to Alpha
    • Installation and Setup
    • Support and Help
    • Terms and Licence
  • Start Here
    • What is Models?
    • Quick start
    • Tutorials
  • Using Taglo Software
    • The Taglo Interface
      • Navigating in Models
      • List Views
      • Adding Items
      • Deleting Items
      • Searching and Filtering
      • Previewing and Editing
      • Using Wizards
      • Save/Undo/Redo
      • Keyboard Shortcuts
    • Data Storage
    • Namespaces
    • Inbuilt data
  • Tags
    • Introduction to Tags
    • Tag Basics
    • Tags Applet
    • Advanced Tags
  • Models
    • Home Tab
      • Creating a Model
        • Timings
      • Version History
      • Application Settings
    • Model Editor
  • Variables
    • Variable Basics
      • Variable Setup
      • Unit and Calculations
    • Time Segments
      • Time Segment Setup
    • Summaries
    • Default Assumptions
  • Units
    • Introduction to Units
    • Key Unit Concepts
    • Advanced Units
    • Defining a Unit
    • Unit Factors
  • Dimensions
    • Introduction to Dimensions
    • Dimension Setup
    • Defining Unit Variance by Dimension
  • Data Types
    • Data Types
  • Assumptions
    • Introduction to Assumptions
    • Creating/Referencing Assumptions
    • Assumptions Wizard
      • Assumption Dates Step
      • Assumption Values Step
      • Linking to external Data
      • Linking to Excel Inserts
      • Sensitivity Values
  • Calculations
    • Introduction to Calculations
    • The Calculation Page
      • The Formula Entry Bar
      • Unit Analysis
    • Calculation Parts
      • Variable References
        • Referencing Time
        • Referencing Dimensions
        • Lookups
        • Summarising Variables
      • Period References
      • Functions
        • Advanced Functions
  • Aggregation
    • Introduction to Aggregation
    • Creating Aggregations
  • Rearranging
    • Introduction to Rearranging
    • Rearranging Example
    • Rearranging Tips
  • Cases
    • Introduction to Cases
    • Managing Scenarios
    • Managing Sensitivities
  • Layout
    • Generating Excel
    • Auto Layout
    • Sheets
      • Sheet Content
      • Adding and Editing Content
    • Excel Formatting
      • Excel Themes and Styles
      • Line Formatting
    • Data Tables
    • Excel Generation Troubleshooting
  • Excel Inserts and Outputs
    • Excel Inserts
    • Excel Outputs
  • Number Formats
    • Number Formats
  • Dashboards
    • Dashboards Basics
    • Dashboard Layout
    • Dashboard Items
    • Excel Dashboards
  • Metrics
    • Metrics
  • Charts
    • Introduction to Charts
    • Chart Customisation
  • Importing Models
    • Importing Models
  • Data
    • Introduction to Data
    • Creating Data
    • Data Sources
Powered by GitBook
On this page
  • Overview
  • Conversions
  • DateTime/Date treatments
  • Comparison with Excel
  1. Data Types

Data Types

Understanding Data Types in Models

PreviousDefining Unit Variance by DimensionNextIntroduction to Assumptions

Last updated 11 months ago

Overview

Models uses seven data types to perform calculations, described in the table below.

Data Type
Description
Link to Microsoft definition

Double

Double-precision floating point number (Excel default number type)

https://learn.microsoft.com/en-us/dotnet/api/system.double?view=net-8.0

Integer

Represents whole numbers from negative to positive 2,147,483,648 (32-bits)

https://learn.microsoft.com/en-us/dotnet/api/system.int32?view=net-8.0

String

Represents a text value

https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0

DateTime

Represents a point in time

https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-8.0

Date

Represents a specific day

https://learn.microsoft.com/en-us/dotnet/api/system.dateonly?view=net-8.0

Boolean

Logical value (TRUE or FALSE)

https://learn.microsoft.com/en-us/dotnet/api/system.boolean?view=net-8.0

Validation

The default Data Type for a is Double.

Conversions

Models calculates values based on the Data Type of each Variable - if you use different Data Types in your Model, values will be converted to the Data Type of their Variable.

For instance, if you have a Variable with Data Type Integer, which performs a Calculation based on two Variables with Data Type Double, the calculation will be performed with Double types, and then converted to an Integer (whole number).

You should bear in mind the following notes on conversions when using multiple Data Types.

Data Type
Conversion notes

String

Text values cannot be converted to numerical values. An error will be shown.

DateTime and Date

See details below

Boolean

TRUE is converted to 1, and FALSE converted to 0 when performing calculations (e.g., 100 * TRUE = 100)

Validation

A Validation value is treated as the text value of the name of its associated Tag

DateTime/Date treatments

Comparison with Excel

Excel uses a smaller set of Data Types than Models:

  • Number

  • Text

  • Logical (TRUE or FALSE)

  • Error

Excel does not differentiate between Double and Integer types, so this should be taken into account when generating Excel. You will need to use a rounding function in your Model if you want to force Excel to output an Integer.

Excel does not automatically convert Logical values to 1 (TRUE) and 0 (FALSE).

For instance, if cells A1 and B1 have values TRUE and FALSE respectively, then A1 + B1 = 1, but SUM(A1, B1) = 0.

Using an equivalent SUM formula in Models would produce the result 1; therefore, it is important, if generating Excel from Models, to check that such calculations produce the desired result.

As a rule of thumb, applying an operator to a TRUE/FALSE value (e.g. +, *) ensures that the value is converted to a number.

Represents a value from a list of choices - each value is the Child of a

Both DateTime and Date are treated in the same way as Excel treats Dates (see ), with 1st January 1900 stored as 1, with each subsequent day increasing the value by 1. Before performing calculations, Models converts Dates to serial numbers to ensure that calculations are performed identically to Excel.

Models treats a Date as midnight at the end of the day when converting to DateTime. Note, that Excel has a bug (described ), in which 1900 is incorrectly assumed to be a leap year. Models replicates this bug to ensure consistency with Excel.

Dates in Excel are stored as numbers, as described .

Variable
here
here
above
Tag
Dimension