LogoLogo
3.6.9
3.6.9
  • Introduction
  • Getting started
    • Installation
      • Prerequisites
        • Server requirements
      • On-premises
        • Single-node
          • Directory structure
        • Multi-node
      • Azure Market Place
      • AWS Market Place
    • Tutorials
      • Amazon AWS CUR
      • Amazon AWS CUR (Athena)
      • Azure Stack
      • Azure EA
      • Azure CSP
      • Google Cloud
      • VMware vCloud
      • VMware vCenter
    • How-to guides
      • How to configure receiving a monthly billing report
      • How to automatically trigger a monthly billing report
      • How to update your license
      • How to store contract information with an Account in a report
      • How to automatically send workflow errors as webhooks to a monitoring system
    • Concepts
      • User interface
      • Services
    • Releases
      • Upgrading to version 3
      • Known issues
      • Announcements
      • Archive
  • Reports
    • Accounts
    • Services
    • Instances
    • Summary
    • Budget
  • Services
    • Manage
    • Rates
      • Tiered Services
        • Aggregation Levels and the Account Hierarchy
    • Adjustments
    • Subscriptions
  • ACCOUNTS
    • Budget management
  • Data pipelines
    • Extract
      • Configuration
      • Extractor templates
      • Script basics
      • Parslets
      • Subroutines
        • check_dateformat
        • check_dateargument
        • format_date
        • validate_response
      • Language
        • aws_sign_string
        • basename
        • buffer
        • csv
        • clear
        • decimal_to_ipv4
        • discard
        • encode
        • encrypt
        • environment
        • escape
        • exit_loop
        • foreach
        • generate_jwt
        • get_last_day_of
        • gosub
        • gunzip
        • hash
        • http
        • if
        • ipv4_to_decimal
        • json
        • loglevel
        • loop
        • lowercase
        • match
        • pause
        • print
        • return
        • save
        • set
        • subroutine
        • terminate
        • unzip
        • uppercase
        • uri
        • var
    • Transform
      • Configuration
      • Transformer templates
      • Transform Preview
      • Language
        • aggregate
        • append
        • calculate
        • capitalise
        • convert
        • copy
        • correlate
        • create
        • default
        • delete
        • dequote
        • environment
        • event_to_usage
        • export
        • finish
        • Functions
        • if
        • import
        • include
        • lowercase
        • normalise
        • option
        • rename
        • replace
        • round
        • services
        • set
        • sort
        • split
        • terminate
        • timecolumns
        • timerender
        • timestamp
        • update_service
        • uppercase
        • var
        • where
    • Datasets
    • Lookups
    • Metadata
    • Reports
    • Workflows
  • Administration
    • User management
      • Users
      • Groups
    • Notifications
      • Budget Notifications
      • Report notifications
      • Workflow notifications
    • Settings
      • Global Variables
      • White Labeling
  • Advanced
    • Integrate
      • GUI automation
        • Examples
      • API docs
      • Single sign-on
        • Claims-based identity provisioning: users, Account access and user groups
        • Azure-AD
        • Auth0
        • OKTA
        • OneLogin
        • ADFS
        • LDAP
    • Digging deeper
      • Authentication flows
      • Transformer datadate
      • Dataset lifecycle
      • Config.json
      • Databases
  • Security
    • Security
    • Authentication
      • Token
      • LDAP
      • SAML2
    • Password reset
    • Password policy
    • Announcements
  • Troubleshooting
    • Logs
  • Terms & Conditions
  • Privacy Policy
Powered by GitBook
On this page
  • Overview
  • Syntax
  • Details
  • Using an expression to set a variable
  • Example

Was this helpful?

Export as PDF
  1. Data pipelines
  2. Transform
  3. Language

var

PreviousuppercaseNextwhere

Last updated 3 years ago

Was this helpful?

Overview

The var statement is used to create or update a variable.

Several variables are automatically created before the commencement of a Transcript task. Please refer to the Variables section in the to this guide for further details.

Syntax

varname=value

As the value may be derived from an expression (see Using an expression to set a variable below) it is recommended that variable values be quoted in order to avoid characters such as / being interpreted as mathematical operators.

Details

A variable is a named value. Once defined, the name can be used in place of the value for the rest of the transcript task. This can be useful in that it permits the configuration of various parameters at the top of a transcript task, which makes maintenance easier.

Both the name and the value parameters must be present, and there must be a space on each side of the = character. To use a space or tab in a variable value, use an escape or double quote the value:

var example = "Hello world"
var example = Hello\ world

A variable is referenced by enclosing its name with ${ and }. For example, a variable called outputFile can be referenced using ${outputFile}.

Variable names are case sensitive, therefore ${variableName} and ${VariableName} are separate variables.

If there is already a variable called name then the var statement will update the value.

The value of a variable may not exceed 1023 characters

Using an expression to set a variable

As well as a literal value, an expression may be specified, in which case the variable is set to the output of that expression. For example:

var value1 = 5
var value2 = 10
var largest = @MAX(${value1}, ${value2})

Example

# ----> Start Config <----
var tmp_folder = AzureTmp
# ----> End Config <----

import "system/extracted/${tmp_folder}/${dataDate}.csv" source Azure alias usage
import "system/extracted/${tmp_folder}/rates.csv" source source Azure alias rates

For a full list of available functions please refer to the section of the documentation for the statement.

Introduction
if
functions