Introduction to Formula Components

Definition

Formulas are a way to show information that is not retrieved by existing objects in a universe. The formula is the definition of how to get that extra information. Formulas look and act a little bit like equations, although they are not necessarily mathematical in nature.

Formulas can have extremely varied contents depending on the need. Still, formulas are composed of only a few different types of things.

Fomulas always start with a leading = sign. After this equals sign, formulas can contain any mix of the following:

  • Text
  • Operators
  • Objects
  • Functions

You will need to understand these components to make more than just the simplest of variables in InfoView.

Video


Formula Components

Leading =

Formulas always start with an equals sign. If you try to save your formula without one, the system will either automatically apply one or give you an error message.

Text

Formulas can contain plain text content. All plain text must be enclosed in double quotation marks.

Example:

="This is my first variable" will show:

This is my first variable

Screenshot of InfoView first variable results

Operators

Operators are the commands and punctuation that holds all of the other contents together. They go in between text, objects and functions to direct the formula on what to do when more than one thing is present.

Example: The Operator "+"

The plus-sign can be used to glue two things together.

="This is" + "my second variable" will show:

This ismy second variable

Screenshot of InfoView second variable results

Note how we have concatinated two discrete text pieces together with the plus sign. We have neglected to add an extra space after "is " or before " my", leading to the two words being smashed together. The plus-sign becomes especially powerful when combined with objects and functions.

Objects

Objects are the fields that you have in your report. It is the same list as is available in the "Available Objects" data palette. All objects will appear in your formula with the name of the object between two corner brackets [].

Objects can be added to your report by using the objects list in the Formula editor window. If you double click on the object, it will pop into your formula where your cursor is already including the [].

Example: Objects Plus Other Objects

When applied between two objects, the plus sign will glue the contents of the two fields together into one field for all values.

=[D Dept Code] + " " + [D Dept Name] will show:

e.g. AMST American Studies

Screenshot of InfoView third variable results

Note: The two quotation marks in the middle of the variable enclose a single space to separate the contents of the two fields.

Functions

Functions perform a task on the data fed into it, usually producing some sort of data or output. They introduce the most complexity and flexibility to formulas. Each function will have a different effect based on what it has been programmed to do. Functions can be combined with any number of objects, text and operators, depending on the need.

Example: Count()

The function Count() is an example of a function that requires an object. When combined with an object, the function Count() will count the number of rows in that field.

=Count([DV Division Name]) will show:

7

Screenshot of InfoView count variable results