EXPAND_ON_UDF

This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.

Definition

Reproduces the functionality of the expand-on function in Teradata.

PUBLIC.EXPAND_ON_UDF(TIME STRING, SEQ NUMBER, PERIOD STRING)

Parameters

TIME STRING

The expand-on time used in nachor.

SEQ NUMBER

The sequence to calculate each row.

PERIOD STRING

The date from the period required.

Returns

A VARCHAR that represents the calculation of the expand-on clause for the period.

Migration example

Input:

SELECT bg FROM table1 EXPAND ON pd AS bg BY ANCHOR ANCHOR_SECOND;

Output:

WITH
--** MSC-WARNING - MSCEWI2078 - THE EXPAND ON CLAUSE FUNCTIONALITY IS TRANSFORMED INTO A CTE BLOCK **
ExpandOnCTE AS
(
SELECT
PUBLIC.EXPAND_ON_UDF('ANCHOR_SECOND', VALUE, pd) /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'EXPAND_ON_UDF' INSERTED. ***/ bg
FROM
table1,
TABLE(FLATTEN(PUBLIC.ROW_COUNT_UDF(PUBLIC.DIFF_TIME_PERIOD_UDF('ANCHOR_SECOND', pd) /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'DIFF_TIME_PERIOD_UDF' INSERTED. ***/) /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'ROW_COUNT_UDF' INSERTED. ***/))
)
SELECT
bg
FROM
table1,
ExpandOnCTE;

Last updated