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.

----product revenue----<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB;<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('DISTRIBUTIONNAME', 'NORMAL');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('MEAN', '8000');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('VARIANCE', '640000');<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE;<br />

CALL DM_<strong>PAL</strong>.<strong>PAL</strong>_DISTRRANDOM(<strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB, <strong>PAL</strong>_CONTROL_TAB,<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE) with overview;<br />

--SELECT * FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE;<br />

----Product Costs---------<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB;<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('DISTRIBUTIONNAME', 'NORMAL');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('MEAN', '2500');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('VARIANCE', '35156.25');<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_COSTS;<br />

CALL DM_<strong>PAL</strong>.<strong>PAL</strong>_DISTRRANDOM(<strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB, <strong>PAL</strong>_CONTROL_TAB,<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_COSTS) with overview;<br />

--SELECT * FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_COSTS;<br />

----OVERHEADS---------<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB;<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('DISTRIBUTIONNAME',<br />

'UNIFORM');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('MIN', '2200');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('MAX', '2800');<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_OVERHEADS;<br />

CALL DM_<strong>PAL</strong>.<strong>PAL</strong>_DISTRRANDOM(<strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB, <strong>PAL</strong>_CONTROL_TAB,<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_OVERHEADS) with overview;<br />

--SELECT * FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_OVERHEADS;<br />

-- calculate cash flow ----<br />

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

CREATE COLUMN TABLE <strong>PAL</strong>_CASHFLOW_YEAR3(ID INTEGER,CASH DOUBLE);<br />

INSERT INTO <strong>PAL</strong>_CASHFLOW_YEAR3 SELECT <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE.ID,<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE.RANDOM<br />

- <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_COSTS.RANDOM -<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_OVERHEADS.RANDOM<br />

FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE left<br />

join <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_COSTS on<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE.ID=<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_COSTS.ID left<br />

join<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_OVERHEADS on<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE.ID=<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_OVERHEADS.ID;<br />

--SELECT * from <strong>PAL</strong>_CASHFLOW_YEAR3;<br />

-----------------------------<br />

--------YEAR 4 --------------<br />

--Product revenue---------<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB;<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('DISTRIBUTIONNAME', 'NORMAL');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('MEAN', '18000');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('VARIANCE', '3240000');<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE;<br />

CALL DM_<strong>PAL</strong>.<strong>PAL</strong>_DISTRRANDOM(<strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB, <strong>PAL</strong>_CONTROL_TAB,<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE) with overview;<br />

--SELECT * FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_REVENUE;<br />

----Product Costs---------<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB;<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('DISTRIBUTIONNAME', 'NORMAL');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('MEAN', '7000');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('VARIANCE', '275625');<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_COSTS;<br />

CALL DM_<strong>PAL</strong>.<strong>PAL</strong>_DISTRRANDOM(<strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB, <strong>PAL</strong>_CONTROL_TAB,<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_COSTS) with overview;<br />

--SELECT * FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_COSTS;<br />

----OVERHEADS---------<br />

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB;<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('DISTRIBUTIONNAME',<br />

'UNIFORM');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('MIN', '2600');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('MAX', '3400');<br />

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

End-to-End Scenarios P U B L I C 561

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

Saved successfully!

Ooh no, something went wrong!