Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The block function is used to render the contents of a block tag more than once.

Example

{% block "testBlock" %}Some content
{% endblock %}
{{ block("testBlock") }}

Output

Some contentSome content

Anchor
_max
_max
max

The max function will return the largest of it's numerical arguments.

Example

{{ max(5, 3) }}

Output

5

Anchor
_min
_min
min

The min function will return the smallest of it's numerical arguments.

Example

{{ min(5, 3) }}

 

Output

3

Anchor
_parent
_parent
parent

The parent function is used inside of a block to render the content that the parent template would have rendered inside of the block had the current template not overriden it.

Template

{% block "${blockName}" %}
{{ parent() }}
{% endblock %}

Anchor
_range
_range
range

The range function will return a list containing an arithmetic progression of numbers.

Example

{{ range(3, 6) }}

Output

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="9bbde057-6725-44e2-9fc8-2f1c9bb31864"><ac:plain-text-body><![CDATA[

[3, 4, 5, 6]

]]></ac:plain-text-body></ac:structured-macro>

...

[3, 4, 5, 6]

Anchor
_range_with_step
_range_with_step
range with step

The range

...

The range function will return a list containing an arithmetic progression of numbers.

[2, 4,

Example

{{ range(2, 10, 2) }}

Output

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="36b11a2f-c6cf-4fd4-b3af-a7c621fc46cb"><ac:plain-text-body><![CDATA[

[2, 4, 6, 8, 10

]

]

]></ac:plain-text-body></ac:structured-macro>

Anchor
_bool
_bool
bool

The bool function will return a boolean from parsing a value.

Example

{{ bool("T") }}

Output

true


Example 2

{{ bool(0) }}

Output

false

Anchor
_codepoint
_codepoint
codepoint

The codepoint function will return the character for the specified Unicode code point.

Example

{{ codepoint(34) }}

Output

"

Anchor
_combine_lists
_combine_lists
combine lists

The combineLists function will return a merged list of the two arguments.

Example

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="95e0857a-6fc2-4fac-8c97-31a024e88c56"><ac:plain-text-body><![CDATA[

{% set listA = [ "a", "b", "c" ] %}
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="964f9128-fae4-4cfd-87f5-4892bfb04c8e"><ac:plain-text-body><![CDATA[{% set listB = [ "d", "c", "e" ] %}
]]></ac:plain-text-body></ac:structured-macro>
{{ combineLists(false, listA, listB) }}
{{ combineLists(true, listA, listB) }}

Output

<ac:structured-macro ac:name="unmigrated-wiki-

{% set listA = [ "a", "b", "c" ] %}
{% set listB = [ "d", "c", "e" ] %}
{{ combineLists(false, listA, listB) }}
{{ combineLists(true, listA, listB) }}

Output

markup" ac:schema-version="1" ac:macro-id="fc98becc-5fd8-4e4d-8976-28f07819cbd1"><ac:plain-text-body><![CDATA[

[a, b, c, d, c, e][a, b, c

, d, e]]]></ac:plain-text-body></ac:structured-macro>

, d, e]

Anchor
_double
_double
double

The double function will return an int for the provided Number argument or attempt to parse a String into a double.

Example

{{ double(3.145) }}

Output

3.145


Example 2

{{ double("3.145") }}

Output

3.145

Anchor
_int
_int
int

The int function will return an int for the provided Number argument or attempt to parse a String into an int.

Example

{{

int

 double("3.145") }}

Output

3


Example 2

{{ int("3.145") }}

Output

3

Anchor
_replace_start
_replace_start
replace start

The replaceStartfunction will return a String where str will be checked if it starts with match and if so be replaced with replace.

Example

{{ replaceStart("prefix", "pre", "suf", false) }}

Output

suffix


Example 2

{{replaceStart("Prefix", "pre", "suf", false) }}

Output

Prefix

Anchor
_replace_end
_replace_end
replace end

The replaceEnd function will return a String where str will be checked if it ends with match and if so be replaced with replace.

Example

{{ replaceEnd("completion", "ion", "ed", false) }}

Output

completed


Example 2

{{replaceEnd("Completion", "ION", "ed", false) }}

Output

Completion

Anchor
_str_is_equals
_str_is_equals
str is equals

The strIsEquals function will return a boolean for whether the provided String arguments are equal. Safely handles null values.

Example

{{ strIsEquals("a", "A", false) }}

Output

true


Example 2

{{strIsEquals("a", "A", false) }}

Output

false


Example 3

{{ strIsEquals("a", null) }}

Output

false

Anchor
_starts_with_ignore_case
_starts_with_ignore_case
starts with ignore case

The startsWithIgnoreCase function will return a boolean for whether the provided str begins with match while ignoring casing.

Example

{{ startsWithIgnoreCase("SuperMan", "super") }}

Output

true

Anchor
_ends_with_ignore_case
_ends_with_ignore_case
ends with ignore case

The endsWithIgnoreCase function will return a boolean for whether the provided str ends with match while ignoring casing.

Example

{{ endsWithIgnoreCase("SuperMan", "man") }}

Output

true

Anchor
_3d_specific_functions
_3d_specific_functions
3D Specific Functions

...

The closestConnection function will return a Connection that is the closest when traversing the source mappings.

Template

{% set ${graphs} = closestConnection(table) %}

Anchor
_createsourcegraph(table_table,_boolean_
_createsourcegraph(table_table,_boolean_
createSourceGraph(Table table, boolean style, boolean denormalize)

...

  • QueryGraph.rootTables - If denormalize is true this contains the original table and all directly related tables, otherwise it only contains the original table.
  • QueryTable.tables - Contains a list of source tables to generate the query over.
  • QueryTable.connection - The associated connection for the set of source tables.

Template

{% set ${graphs} = createSourceGraph(table, ${style}, ${denormalize}) %}

Anchor
_createsourcegraphbyset(table_table,_str
_createsourcegraphbyset(table_table,_str
createSourceGraphBySet(Table table, String sourceSetName, boolean style, boolean denormalize)

The createSourceGraphBySet function will return a list of QueryGraphs, one for each source connection, containing the tables for a query by the given source set.
The style flag is set to true for calculating a data query or false for a data warehouse query.
The denormalize flag determines whether to calculate a query with any related tables to the provided table.

  • QueryGraph.rootTables - If denormalize is true this contains the original table and all directly related tables, otherwise it only contains the original table.
  • QueryTable.tables - Contains a list of source tables to generate the query over.
  • QueryTable.connection - The associated connection for the set of source tables.

Template

{% set ${graphs} = createSourceGraphBySet(table, ${sourceSet}, ${style}, ${denormalize}) %}

Anchor
_getprofilingvalues(table/column/relatio
_getprofilingvalues(table/column/relatio
getProfilingValues(Table/Column/Relation obj, String metric, boolean casing)

The getProfilingValues function will return a list of all the values for the specified profiling metric name on a given object.

Example

{%- for col in table.columns -%}
    {%- if col.name == "City" -%}
        {

...

%- set pv = getProfilingValues(col,"Avg character count",true) -%}
        Avg character count: {{pv[0].snd

...

}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Avg character count: 8

 


Example 2

{%- for col in table.columns -%}
    {%- if col.name == "CategoryID" -%}

...

        {%- set pv=getProfilingValues(col,"AVG Value",false) -%}
        Avg value: {{pv[0].snd

...

}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Avg value: 4.5

 


Example 3

{%- for col in table.columns -%}
    {%- if col.name == "City" -%}
        {%

...

- set pv = getProfilingValues(col,"Distinct value count",true)
%}
        Distinct value count: {{pv[0].snd

...

}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Distinct value count: 69

 


Example 4

{%- for col in table.columns -%}
    {%- if col.name == "City" -%}
        {%

...

- set pv = getProfilingValues(col,"Max character count",true) -%}
        Max character count: {{pv[0].snd

...

}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Max character count: 15

...


Example 5

{%- for col in table.columns -%}
    {%- if col.name == "City" -%}
        {%-

...

 set pv = getProfilingValues(col,"Max trimmed length",true) -%}
        Max trimmed length: {{pv[0].snd}}{

...

%br%}
    {%- endif -%}
{%- endfor -%}

Output

Max trimmed length: 15

 


Example 6

{%- for col in table.columns -%}

...

    {%-

...

 if col.

...

name == "City" -%}
        {

...

%- set pv = getProfilingValues(col,"Min character count",true) -%}
        Min character count: {{pv[0].snd

...

}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Avg character count: 4

 


Example 7

{%- for col in table.columns -%}
    {%- if col.name == "Region" -%}
        

...

{%- set pv = getProfilingValues(col,"Null %",true) -%}
        Percentage Null: {{pv[0].snd

...

}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Percentage Null: 65.93%

 


Example 8

{%- for col in table.columns -%}
    {%- if col.name == "Region" -%}
        {

...

%- set pv = getProfilingValues(col,"Null count",true) -%}
        Null count: {{pv[0].snd

...

}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Null count: 60

 


Example 9

{%- for col in table.columns -%}
    {%- if col.name == "CategoryID" -%}

...

        {%- set pv = getProfilingValues(col,"Numeric range",true) -%}
        Numeric range: {{pv[0].snd

...

}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Numeric range: 7


Example 10

{%- for col in table.columns -%}
    {%- if col.name == "Region %" -%}

...

        {%- set pv = getProfilingValues(col,"Populated",true) -%}
        Percentage populated: {{pv[0].snd

...

}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Percentage Populated: 34.07%


Example 11

{%- for col in table.columns -%}
    {%- if col.name == "Region" -%}
        {%- set

...

 pv = getProfilingValues(col,"Populated count",true) -%}
        Populated count: {{pv[0].snd}}{

...

%br%}
    {%- endif -%}
{%- endfor -%}

Output

Populated count: 31

...


Example 12

{%- for col in table.columns -%}
    {%- if col.name

...

 == "CategoryID" -%}
        {%- set pv = getProfilingValues(col,"Sum value",true) -%}
        Sum value: {{pv[0].snd}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Sum value: 36.0

 


Example 13

{%- for col in table.columns -%}

    {%- if col.name == "City" -%}

        {%- set pv = getProfilingValues(col,"Top 10 most frequent values",true) -%}

        Top 10 most frequent values:{

...

%br%}

        {%- for v in pv -%}

            {{loop.index + 1}}- {{v.fst}}: {{v.snd}}{

...

%br%}

        {%- endfor -%}

    {%- endif -%}

{%- endfor -%}

Output

Top 10 most frequent values
1- London: 6
2- México D.F.: 5
3- Sao Paulo: 4
4- Rio de Janeiro: 3
5- Madrid: 3
6- Buenos Aires: 3
7- Paris: 2
8- Portland: 2
9- Nantes: 2
10- Lisboa: 2

 


Example 14

{%- for col in table.columns -%}
    {%- if col.name == "CategoryID" -%}
        {%- set pv =

...

 getProfilingValues(col,"Min value",true) -%}
        Min value: {{pv[0].snd}}{

...

%br%}
    {%- endif -%}
{%- endfor -%}

Output

Min value: 1

...


Example 15

{%- for col in table.columns -%}
    {%- if col.name == "CategoryID" -%}
        {%- set pv = getProfilingValues(col,"Max value",true) -%}

...

        Max value: {{pv[0].

...

snd}}{%br%}
    {%- endif -%}
{%- endfor -%}

Output

Max value: 8

Anchor
_mapduplicatealias(list<table>_tables,_l
_mapduplicatealias(list<table>_tables,_l
mapDuplicateAlias(List<Table> tables, List<QueryTable> queryTables)

The mapDuplicateAlias function returns a mapping from source table aliases to root tables in the tables list with multiple aliases in the queryTables list.

Template

{%

...

 set ${mapping} = mapDuplicateAlias( ${tables}, %{queryTables}) %}

Anchor
_parsequery(string_query)
_parsequery(string_query)
parseQuery(String query)

The parseQuery function will parse a query String into a QueryDefinition object.

Template

{% set ${parsed} = parseQuery( ${query}) %}

Anchor
_quote(string_query,_string

...

Template

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2799eab9-8486-4913-9554-f7039108aad4"><ac:plain-text-body><![CDATA[

...

{{ quote("SELECT * FROM `TUTORIAL`.`CUSTOMER`;", "[", "]") }}

...

]]></ac:plain-text-body></ac:structured-macro>

...

Output

_openquote,_s
_quote(string_query,_string_openquote,_s
quote(String query, String openQuote, String closeQuote)

The quote function convert any '`'s to the provided open and closing quotes.

Template

{{ quote("SELECT * FROM `TUTORIAL`.`CUSTOMER`;", "[", "]") }}

Output

...

SELECT * FROM [TUTORIAL].[CUSTOMER];

...

]]></ac:plain-text-body></ac:structured-macro>

Anchor
_uniquetablename(table_table,_string_tab
_uniquetablename(table_table,_string_tab
uniqueTableName(Table table, String tableName, String schemaName)

The uniqueTableName function will return a String for a unique table name based on the provided names.

Example

{#- table is named TUTORIAL.CUSTOMER. And TUTORIAL.PRODUCT exists -#}

{{- uniqueTableName(table, "CUSTOMER", "TUTORIAL") -}}{%- br -%}
{{- uniqueTableName(table, "PRODUCT", "TUTORIAL") -}}

Output

CUSTOMER
PRODUCT_1