# Windward Equations and Functions Overview

Report Designer Office Edition (*the Designer*) has built-in *equations *and *functions *for use in your Tags. In this context, the terms "equations" and "functions" are often used interchangeably, or "equation" may refer to mathematical formulas using symbols such as "+" or "mod", while "function" refers to named functions that can also perform non-mathematical operations such as "CONCATENATE()" or "DATA()". Although Windward equations and functions may appear similar they are *not *the same as the functions, equations, and macros that are native to MS Office.

Windward equations and functions give you a great deal of control over the data you retrieve from your data source. For example, you can:

Work with more complex mathematical functions, like taking the the square root of a number

Add or subtract from a date while adjusting for time zones

Easily add a time stamp that is set when your output is generated

Have your equation evaluated as you type

Create and import

**[custom Windward functions]**that will appear in the Designer interface

## About Variables

Windward variables you create with Tags such as the ForEach or Set Tags can be referenced in Windward equations and functions using the "${VariableName}" syntax. The value of a variable reference is substituted for that reference when an equation or function is evaluated. For example, if the value of ${var1} had previously been set to "2", then the equation "2 + ${var1}" becomes "2 + 2", which returns "4".

## About Equations

An equation is typically a mathematical or logical expression that returns a single value when evaluated. In the Query Panes of Tags these expressions begin with "=" to indicate the Evaluate select statement mode is used:

Arithmetic equations return a number, such as "=2 + 3", which returns 5. Logical equations return the Boolean values *true* and *false*, such as "=2 <= 3" (2 is less than or equal to 3), which returns *true*.

### Common Mathematical Operators

Here are some common mathematical operators you can use when writing your equations:

Arithmetic Operators | |
---|---|

Addition | + |

Subtraction | - |

Multiplication | * |

Division | / |

Comparison Operators | |
---|---|

Equal | = |

Not Equal | != |

Less Than | < |

Greater Than | > |

Less Than or Equal to | <= |

Greater Than or Equal to | >= |

For the full list of supported mathematical operators see the Windward Equations Operators Reference.

## About Functions

In addition to numbers, Windward functions operate on and return many other types of data including strings, dates, data sets returned from Tag select statements, etc.

All of the Windward functions are accessible through the Equation Editor:

For the complete list of Windward functions see the Windward Functions Reference.

## Microsoft Office Product-Specific Notes

### Word and PowerPoint

Microsoft Word and PowerPoint do not have the ability to use equations and functions within the program natively (only Excel has its own set of equations and functions). Microsoft Word and PowerPoint do have an equation button located in the Symbols section of the Insert tab. However, this just gives the ability to write equations that appear in multi-line formats so they display cleanly in the document. These equations are not evaluated and do not produce a result.

This is why Windward built a library of equations and functions to be used within Windward Tags.

### Excel

Microsoft Excel works differently. In addition to using Windward equations and functions within Tags in Excel, you can also use Excel native functions and equations. This is a special feature of Windward that automatically evaluates native Excel equations when creating output.

An example of this is when you use the native Excel function SUM() to point to a cell that contains a Windward Out Tag. Lets say you have an Out Tag within a ForEach Tag loop in cell E10. That Out Tag returns a subtotal with each iteration of the ForEach Tag loop. If the loop iterates 20 times, then Windward (because it supports updating the Excel SUM() function) will produce output that literally changes the original native Excel function "SUM(E10)" to "SUM(E10:E20)". This is because the cell referred to in the SUM() function increased from a single cell to a range of 20 cells E10 to E20. The result is that since the SUM() function was updated it will display the proper sum of all 20 subtotals generated from the Out Tags.

Windward supports any Excel function or formula with a reference(s) to a cell(s) within a ForEach Tag area. Cells references outside a ForEach Tag area will not have their formulas or functions updated with values and/or cell ranges by Windward, which can cause incorrect results.