ADDTOTAL and GETTOTAL Functions

This article will explain about the ADDTOTAL and GETTOTAL functions.

You can reference all available macros in this article: Windward Functions Reference.

ADDTOTAL

The ADDTOTAL function adds a given value to a name variable. If you call the function like ADDTOTAL (10,'total') it adds ten to the variable named 'total'. 

This variable is NOT a template variable, and can not be accessed through any other function or tag.

ADDTOTAL does not return any data, so if you use it in an Out tag the tag will be hidden in the output.

To show the current value of the variable, use the GETTOTAL function with the name of the variable you want to show, e.g. GETTOTAL ('total').

Syntax

ADDTOTAL(value, variable)

  • value - Required. The number you want to add to your running total.
  • variable - Required. The name of the variable you wish to keep to use to keep track of the total (a string).

GETTOTAL(variable)

  • variable - Required. The name of the variable you wish to get the current total for (a string).

See how to use ADDTOTAL/GETTOTAL to calculate a running total in this step-by-step example: Calculate Running Totals

0 Comments

Add your comment

E-Mail me when someone replies to this comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.