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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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 />

left join<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_INVESTMENT on<br />

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

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

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

------------YEAR 2 --------------<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', '3000');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('VARIANCE', '90000');<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', '1000');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('VARIANCE', '5625');<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', '1800');<br />

INSERT INTO <strong>PAL</strong>_DISTRRANDOM_DISTRPARAM_TAB VALUES ('MAX', '2200');<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 />

----INVESTMENT---------<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', '2000');<br />

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

DELETE FROM <strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_INVESTMENT;<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_INVESTMENT) with overview;<br />

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

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

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

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

INSERT INTO <strong>PAL</strong>_CASHFLOW_YEAR2 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 />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_INVESTMENT.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 />

left join<br />

<strong>PAL</strong>_DISTRRANDOM_RESULT_TAB_INVESTMENT on<br />

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

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

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

----------YEAR 3 ------------<br />

560 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 />

End-to-End Scenarios

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

Saved successfully!

Ooh no, something went wrong!