Skip to main content

Fields - Calculation


Calculations can reference other fields such as dimensions, measures and calculations.

fields:   #begin of fields section (inside View or Model)
- calculation: calculation_name
hidden: false
label: 'field label in UI'
description: 'description in UI'
result: calculation_result
sql: 'SQL expression'
format_number: '$,.0f'
currency_prefix: $
currency_suffix: ''

Calculation Parameters

calculation*string-Field name
labelstring-Override field name in UI
hiddenbooleanfalseHide field in UI
descriptionstring-Field description in UI
resultenum"number"Resulting data type (after SQL transformations):
  • string - use for strings
  • number - use for numbers or integers (default for calculations)
sql*string-Way to calculate field through SQL expression (must use BlockML reference to other fields - dimensions, measures, calculations)
format_numberstring-Format Number
currency_prefixstring-Format Number - Symbol
currency_suffixstring-Format Number - Symbol