SQL Call
SELECT
id,
period_start,
period_end,
cast (expenditure_saxcode AS VARBYTE(50)) AS expenditure_saxcode,
expenditure_mean,
expenditure_stdev,
cast (income_saxcode AS VARBYTE(50)) AS income_saxcode,
income_mean,
income_stdev,
cast (investment_saxcode AS VARBYTE(50)) AS investment_saxcode,
investment_mean,
investment_stdev
FROM SAX (
ON finance_data3 AS "input" PARTITION BY id ORDER BY period
USING
TargetColumns ('expenditure','income','investment')
TimeColumn ('period')
WindowType ('global')
OutputStats ('true')
Accumulate ('id')
) AS dt ORDER BY 1;
Output
id |
period_start |
period_end |
expenditure_saxcode |
expenditure_mean |
expenditure_stdev |
income_saxcode |
income_mean |
income_stdev |
investment_saxcode |
investment_mean |
investment_stdev |
1 |
1960Q1 |
1969Q4 |
61616161626262626262626262626262626262626262626262626262626262636363636364646464 |
714.2 |
385.0403375472 |
61616161626262626262626262626262626262626262626262626262626262636363636364646464 |
811.2 |
449.682520486142 |
61616161616161626262626261626262626262626263636363636363626262636262636364646464 |
301 |
130.70871903117 |
2 |
1970Q1 |
1979Q4 |
64646464646464646161616161616161616161616262626262626262626262636363636363636364 |
1355.6 |
404.842280147309 |
64646464646464646161616161616161616161616262626262626262626263636363636363636363 |
1589.275 |
470.779059045639 |
64646464646464646161616161616161626262626262626263626262636262626262626262636363 |
556.675 |
142.199821035626 |
3 |
1980Q1 |
1982Q4 |
616161616363636464646464 |
2045.16666666667 |
256.612489362793 |
616161616363636464646464 |
2387.41666666667 |
317.496587908175 |
616161616364646363636363 |
759.083333333333 |
113.352594174375 |