SPOOL CWM.LOG

REM create a new CWM2 measure folder off of the root folder
REM first parameter is name of measure folder and
REM second parameter is catalog description
REM third optional parameter is the parent folder name to create the folder from.

execute cwm2_olap_catalog.create_catalog('SHAW MEASURES', 'Electronics - Trend Calculations');
execute cwm2_olap_catalog.create_catalog('SHAW KEYS', 'Electronics - KPIs');

REM to create a measure in a measure folder
REM parameters are measure folder name, cube owner, cube name, measure name
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD_12MMA');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD_6MMA');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD_FCAST_BF');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD_FCAST_EXPO');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD_FCAST_LINEAR');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD_FCAST_NLINEAR');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD_FCAST_SEASONAL');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD_FCAST_TREND');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD_PCT_CHANGE_PP');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD_PCT_CHANGE_YRAGO');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'COSTS');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'COSTS_12MMA');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'COSTS_6MMA');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'COSTS_FCAST_BF');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'COSTS_PCT_CHANGE_PP');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'COSTS_PCT_CHANGE_YRAGO');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'MARGIN_12MMA');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'MARGIN_6MMA');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'MARGIN_FCAST_BF');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'MARGIN_PCT_CHANGE_PP');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'MARGIN_PCT_CHANGE_YRAGO');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'MARGIN_PERCENT');
execute cwm2_olap_catalog.add_catalog_entity('SHAW MEASURES', 'CS_OLAP', 'SHAWSALES', 'QUANTITY_SOLD');

execute cwm2_olap_catalog.add_catalog_entity('SHAW KEYS', 'CS_OLAP', 'SHAWSALES', 'AMOUNT_SOLD');
execute cwm2_olap_catalog.add_catalog_entity('SHAW KEYS', 'CS_OLAP', 'SHAWSALES', 'COSTS');
execute cwm2_olap_catalog.add_catalog_entity('SHAW KEYS', 'CS_OLAP', 'SHAWSALES', 'QUANTITY_SOLD');

execute cwm2_olap_metadata_refresh.mr_refresh();
commit;
/
SPOOL OFF
quit;
