DAZL Documentation | Data Analytics A-to-Z Processing Language


Contents

Variable Substitution with Dot Notation

beginner fundamentals

slug: example-fundamentals-variable-substitution-with-dot-notation

Variables in DAZL are treated as global, available to all steps when defined in the 'variables' section of the script. Variables can be organized into hierarchies in YAML, and the hierarchies can be referenced with dot notation between the layers.

Problem

You have nested configuration variables and need to reference them in steps.

Solution

Use dot notation inside curly braces: {parent.child}

Example

variables:
  database:
    mySourceFile: freqTest
    backupSource: freqTest_backup

steps:
  - stepName: load
    dataset: 
      source: "{database.mySourceFile}"  # Resolves to "freqTest"
      type: sql
    output: dataToAnalyze

Why This Matters

  • Centralize configuration: Change mySourceFile in one place
  • Environment flexibility: Different values for dev/prod
  • Readability: {database.mySourceFile} is clearer than just freqTest

Related