How to Create a New Variable

  1. Right click on the Variables folder in the Available Objects window and select New. This opens up the Variable Editor.
  2. Name: Name the variable something descriptive
  3. Type: This will populate automatically after the formula is entered
  4. Description: This is optional; allows you to describe the variable's function
  5. Qualification: Dimension, Measure, or Detail (variables will automatically change to measure if there is an aggregate function)
  6. Formula: Type the formula for the variable into the formula pane
  7. Validate Formula: Tells you if the formula is defined correctly or if there are errors
  8. Cancel: erases any changes made within the last edit

You can use created variables in a formula or within the report in exactly the same way as you use other report objects. They will appear in the Variables folder within the Available Objects window.

  • To edit a variable, double click it, or right click and choose Edit.
  • To delete a variable, right click on the variable and select Delete. This will permanently delete the variable.
  • To create a copy of a variable, right click on the variable and select Duplicate.  The copy can be edited and adjusted as needed.
    This is useful when similar variables need to be created many times (very helpful for flattening data).

Any formula created can be turned into a variable if the formula needs to be used in other formulas/variables.

Click here for instructions on how to Create A Variable from a Formula

Notes

Square brackets [   ] should surround data elements.  Always place a semicolon (;) between dimensions where referencing multiple data points.

Rounded Parentheses (  ) should surround and group the functions/operators to be performed; everything within the parentheses of a function or operator is related to that action

  • Issues with too many or too few parentheses are common—be sure to count your parentheses to be sure you are aren’t missing any!
  • If your variable doesn’t behave the way you expect, misplaced parentheses are a common culprit.  Be sure you have grouped your actions they way you intended.


Formulas are performed following mathematical logic--actions are performed from the inside to the outside.  Be sure to remember this as you consider the order of your formulas.

Specific considerations/actions are performed first (and will be towards the middle of a formula) and over-arching actions are performed last (and will be towards the outside of the formula).

Did this answer your question?