25.10.2016 Views

SAP HANA Predictive Analysis Library (PAL)

sap_hana_predictive_analysis_library_pal_en

sap_hana_predictive_analysis_library_pal_en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

"RANDOM" DOUBLE<br />

);<br />

DROP TABLE <strong>PAL</strong>_TSSEASONALITY_PDATA_TBL;<br />

CREATE COLUMN TABLE <strong>PAL</strong>_TSSEASONALITY_PDATA_TBL(<br />

"POSITION" INT,<br />

"SCHEMA_NAME" NVARCHAR(256),<br />

"TYPE_NAME" NVARCHAR(256),<br />

"PARAMETER_TYPE" VARCHAR(7)<br />

);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_PDATA_TBL VALUES (1, 'DM_<strong>PAL</strong>',<br />

'<strong>PAL</strong>_TSSEASONALITY_DATA_T', 'IN');<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_PDATA_TBL VALUES (2, 'DM_<strong>PAL</strong>',<br />

'<strong>PAL</strong>_TSSEASONALITY_CONTROL_T', 'IN');<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_PDATA_TBL VALUES (3, 'DM_<strong>PAL</strong>',<br />

'<strong>PAL</strong>_TSSEASONALITY_SEASONALITY_T', 'OUT');<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_PDATA_TBL VALUES (4, 'DM_<strong>PAL</strong>',<br />

'<strong>PAL</strong>_TSSEASONALITY_RANDOM_T', 'OUT');<br />

CALL "SYS".AFLLANG_WRAPPER_PROCEDURE_DROP('DM_<strong>PAL</strong>',<br />

'<strong>PAL</strong>_TIMESERIESSEASONALITY_PROC');<br />

CALL "SYS".AFLLANG_WRAPPER_PROCEDURE_CREATE('AFL<strong>PAL</strong>', 'SEASONALITYTEST',<br />

'DM_<strong>PAL</strong>', '<strong>PAL</strong>_TIMESERIESSEASONALITY_PROC', <strong>PAL</strong>_TSSEASONALITY_PDATA_TBL);<br />

DROP TABLE <strong>PAL</strong>_TSSEASONALITY_DATA_TBL;<br />

CREATE COLUMN TABLE <strong>PAL</strong>_TSSEASONALITY_DATA_TBL LIKE <strong>PAL</strong>_TSSEASONALITY_DATA_T;<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (1, 10);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (2, 7);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (3, 17);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (4, 34);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (5, 9);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (6, 7);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (7, 18);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (8, 40);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (9, 27);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (10, 7);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (11, 27);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (12, 100);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (13, 93);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (14, 29);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (15, 159);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (16, 614);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (17, 548);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (18, 102);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (19, 21);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (20, 238);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (21, 89);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (22, 292);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (23, 446);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (24, 689);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (25, 521);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (26, 155);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (27, 968);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (28, 1456);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (29, 936);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (30, 10);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (31, 83);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (32, 55);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (33, 207);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (34, 25);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (35, 0);<br />

INSERT INTO <strong>PAL</strong>_TSSEASONALITY_DATA_TBL VALUES (36, 0);<br />

DROP TABLE #<strong>PAL</strong>_TSSEASONALITY_CONTROL_TBL;<br />

CREATE LOCAL TEMPORARY COLUMN TABLE #<strong>PAL</strong>_TSSEASONALITY_CONTROL_TBL (<br />

"NAME" VARCHAR(100),<br />

"INTARGS" INTEGER,<br />

"DOUBLEARGS" DOUBLE,<br />

"STRINGARGS" VARCHAR (100)<br />

);<br />

INSERT INTO #<strong>PAL</strong>_TSSEASONALITY_CONTROL_TBL VALUES ('ALPHA', null, 0.05, null);<br />

DROP TABLE <strong>PAL</strong>_TSSEASONALITY_SEASONALITY_TBL;<br />

420 P U B L I C<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Predictive</strong> <strong>Analysis</strong> <strong>Library</strong> (<strong>PAL</strong>)<br />

<strong>PAL</strong> Functions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!