GCS Hierarchy Listing Data Source

Description
Categories: BI Publisher
Application: Financial Consolidation Hub (Obsolete)
Source:
Short Name: GCS_HIER_LIST_SOURCE
DB package:
SELECT ghv.HIERARCHY_NAME,
       ghv.DESCRIPTION,
       fev.ENTITY_NAME,
       LEVEL,
       gcr.start_date,
       gcr.end_date,
       decode( gcr.entity_type_code, 
	       'E', to_number(''),
               decode( gcr.operassoc_parent_entity_id,
	               to_number(''), gcr.ownership_percent,
                       decode(gcr.entity_type_code, 
		              'O',-1,to_number('')))) ownership_percent,
       decode( gcr.operassoc_parent_entity_id,
               to_number(''),to_number(''), 
               decode(gcr.entity_type_code, 
	              'O',-1,to_number(''))) ownership_order,
       gtv.treatment_name,
       gctv.curr_treatment_name,
       gcr.entity_type_name ENTITY_TYPE_NAME,
       gcr.currency_name,
       decode(gcr.entity_type_code,'C',2,'O',1,'E',3) entity_type
  FROM gcs_hierarchies_vl ghv,
       fem_entities_vl fev,
       (select gcr.hierarchy_id,
               gcr.parent_entity_id,
               gcr.child_entity_id,
               treatment_id,
               curr_treatment_id,
               ownership_percent,
               start_date,
               end_date,
               fetv.entity_type_code,
               fetv.entity_type_name ENTITY_TYPE_NAME,
               fcv.name CURRENCY_NAME,
               operassoc.parent_entity_id  operassoc_parent_entity_id
          FROM gcs_cons_relationships gcr,
               fem_entities_attr      fea,
               fem_entity_types_vl    fetv,
               fnd_currencies_vl      fcv,
               gcs_entity_cons_attrs  geca,
               (SELECT	operea.entity_id AS parent_entity_id,
                        operea.dim_attribute_numeric_member AS child_entity_id
                FROM	FEM_ENTITIES_ATTR operea,
                        FEM_DIM_ATTRIBUTES_B ope