DBA Data[Home] [Help]

MATERIALIZED VIEW: APPS.FII_GL_BASE_MV

Source


SELECT  /* 12.0: bug#4526784 */       'ACTUAL'                    UMARKER,         b.time_id		      TIME_ID,         b.period_type_id	      PERIOD_TYPE_ID,         m.parent_manager_id          MANAGER_ID,         b.prod_category_id	      PRODUCT_CATEGORY_ID,         m.company_cost_center_org_id COST_CENTER_ORG_ID,         b.je_source 		      JE_SOURCE,         b.ledger_id                  LEDGER_ID,         SUM(DECODE(a.fin_cat_type_code, 'R', b.amount_b, -b.amount_b)) ACTUAL_B,         SUM(DECODE(a.fin_cat_type_code, 'R', b.prim_amount_g,                                               -b.prim_amount_g))         PRIM_ACTUAL_G,         SUM(DECODE(a.fin_cat_type_code, 'R', b.sec_amount_g,                                               -b.sec_amount_g))          SEC_ACTUAL_G,         m.parent_lob_id              LINE_OF_BUSINESS_ID,         c.parent_fin_cat_id	      FIN_CATEGORY_ID,         0              PRIM_BUDGET_G,         0              SEC_BUDGET_G,         0              PRIM_FORECAST_G,         0              SEC_FORECAST_G,         b.functional_currency        FUNCTIONAL_CURRENCY,         count(DECODE(a.fin_cat_type_code, 'R', b.amount_b, -b.amount_b)) ACTUAL_BCT,         count(DECODE(a.fin_cat_type_code, 'R', b.prim_amount_g, -b.prim_amount_g)) PRIM_ACTUAL_GCT,         count(DECODE(a.fin_cat_type_code, 'R', b.sec_amount_g,  -b.sec_amount_g))  SEC_ACTUAL_GCT,         count(0) PRIM_BUDGET_GCT,         count(0) SEC_BUDGET_GCT,         count(0) PRIM_FORECAST_GCT,         count(0) SEC_FORECAST_GCT,         count(*) CT   FROM  FII.FII_GL_JE_SUMMARY_B     b,         FII.FII_COM_CC_MAPPINGS     m,         FII.FII_FIN_CAT_MAPPINGS    c,         FII.FII_FIN_CAT_TYPE_ASSGNS a   WHERE b.company_id      = m.company_id   AND   b.cost_center_id  = m.cost_center_id   AND   m.valid_mgr_flag  = 'Y'   AND   c.child_fin_cat_id = b.fin_category_id   AND   a.fin_category_id = b.fin_category_id   AND   a.fin_cat_type_code in ('R', 'EXP')   GROUP BY         b.time_id,         b.period_type_id,         m.parent_manager_id,         b.prod_category_id,         m.company_cost_center_org_id,         b.je_source,         b.ledger_id,         m.parent_lob_id,         c.parent_fin_cat_id,         b.functional_currency   UNION ALL   SELECT    /* 12.0: bug#4526784 */      'BUDGET'                   UMARKER,         b.time_id		      TIME_ID,         b.period_type_id	      PERIOD_TYPE_ID,         m.parent_manager_id          MANAGER_ID,         b.category_id	  	      PRODUCT_CATEGORY_ID,         m.company_cost_center_org_id COST_CENTER_ORG_ID,         to_char(null) 		      JE_SOURCE,         to_number(null)              LEDGER_ID,         to_number(null)              ACTUAL_B,         to_number(null)              PRIM_ACTUAL_G,         to_number(null)              SEC_ACTUAL_G,         m.parent_lob_id              LINE_OF_BUSINESS_ID,         c.parent_fin_cat_id	      FIN_CATEGORY_ID,         sum(decode(plan_type_code, 'B', prim_amount_g, 0)) PRIM_BUDGET_G,        sum(decode(plan_type_code, 'B', sec_amount_g, 0))  SEC_BUDGET_G,        sum(decode(plan_type_code, 'F', prim_amount_g, 0))   PRIM_FORECAST_G,        sum(decode(plan_type_code, 'F', sec_amount_g, 0))    SEC_FORECAST_G,        to_char(null)                FUNCTIONAL_CURRENCY,         count(to_number(null))       ACTUAL_BCT,         count(to_number(null))       PRIM_ACTUAL_GCT,         count(to_number(null))       SEC_ACTUAL_GCT,         count(decode(plan_type_code, 'B', prim_amount_g, 0)) PRIM_BUDGET_GCT,         count(decode(plan_type_code, 'B', sec_amount_g,  0)) SEC_BUDGET_GCT,         count(decode(plan_type_code, 'F', prim_amount_g, 0)) PRIM_FORECAST_GCT,         count(decode(plan_type_code, 'F', sec_amount_g,  0)) SEC_FORECAST_GCT,         count(*) CT   FROM  FII.FII_BUDGET_BASE      b,         FII.FII_FIN_CAT_MAPPINGS c,         FII.FII_COM_CC_MAPPINGS  m    WHERE b.company_cost_center_org_id = m.company_cost_center_org_id     AND b.fin_category_id            = c.child_fin_cat_id     AND m.valid_mgr_flag  = 'Y'   GROUP BY      b.time_id,       b.period_type_id,	      m.parent_manager_id,       b.category_id,       m.company_cost_center_org_id,       m.parent_lob_id,      c.parent_fin_cat_id