DBA Data[Home] [Help]

MATERIALIZED VIEW: APPS.ISC_TRN_000_MV

Source


SELECT /* 12.0: bug#4526784 */  fact.organization_id		INV_ORG_ID, fact.shipment_direction 	SHIPMENT_DIRECTION, fact.carrier_id		CARRIER_ID, fact.mode_of_transport		MODE_OF_TRANSPORT, fact.service_level		SERVICE_LEVEL, grouping_id(service_level, organization_id, carrier_id) AGG_LEVEL, grouping_id(fact.organization_id, fact.shipment_direction, fact.carrier_id, fact.mode_of_transport, fact.service_level, cal.ent_qtr_id, cal.ent_period_id, cal.week_id, cal.report_date_julian) GRP_ID, decode(grouping_id(cal.ent_qtr_id, cal.ent_period_id, cal.week_id, cal.report_date_julian),        14,cal.report_date_julian,13,cal.week_id, 11,cal.ent_period_id,7,cal.ent_qtr_id) TIME_ID, decode(grouping_id(cal.ent_qtr_id,cal.ent_period_id,cal.week_id,cal.report_date_julian),	14,1,13,16,11,32,7,64) PERIOD_TYPE_ID, cal.report_date_julian		DAY_ID,  cal.week_id			WEEK_ID, cal.ent_period_id		ENT_PERIOD_ID, cal.ent_qtr_id			ENT_QTR_ID, sum(decode(fact.freight_weight_g, null, 0, fact.freight_cost_f)) 	FREIGHT_COST_WT_F, count(decode(fact.freight_weight_g, null, 0, fact.freight_cost_f)) 	COST_WT_F_CNT, sum(decode(fact.freight_weight_g, null, 0, fact.freight_cost_g)) 	FREIGHT_COST_WT_G, count(decode(fact.freight_weight_g, null, 0, fact.freight_cost_g)) 	COST_WT_G_CNT, sum(decode(fact.freight_weight_g, null, 0, fact.freight_cost_g1)) 	FREIGHT_COST_WT_G1, count(decode(fact.freight_weight_g, null, 0, fact.freight_cost_g1)) 	COST_WT_G1_CNT, sum(decode(fact.freight_volume_g, null, 0, fact.freight_cost_f)) 	FREIGHT_COST_VOL_F, count(decode(fact.freight_volume_g, null, 0, fact.freight_cost_f)) 	COST_VOL_F_CNT, sum(decode(fact.freight_volume_g, null, 0, fact.freight_cost_g)) 	FREIGHT_COST_VOL_G, count(decode(fact.freight_volume_g, null, 0, fact.freight_cost_g)) 	COST_VOL_G_CNT, sum(decode(fact.freight_volume_g, null, 0, fact.freight_cost_g1)) 	FREIGHT_COST_VOL_G1, count(decode(fact.freight_volume_g, null, 0, fact.freight_cost_g1)) 	COST_VOL_G1_CNT, sum(fact.freight_weight_g) 	FREIGHT_WEIGHT_G, count(fact.freight_weight_g) 	FREIGHT_WEIGHT_G_CNT, sum(fact.freight_volume_g) 	FREIGHT_VOLUME_G, count(fact.freight_volume_g) 	FREIGHT_VOLUME_G_CNT, count(*) CNT FROM ISC.ISC_DBI_DEL_LEGS_F fact,      FII.FII_TIME_DAY cal WHERE fact.time_init_dept_date_id = cal.report_date   AND fact.freight_cost_f IS NOT NULL   AND (fact.parent_delivery_leg_id IS NULL    OR fact.delivery_type='CONSOLIDATION') GROUP BY mode_of_transport, shipment_direction, rollup(carrier_id), rollup(service_level), rollup(organization_id), grouping sets(cal.ent_qtr_id, cal.ent_period_id, cal.week_id, cal.report_date_julian)