-- This setup script:
--
-- * Copies dimension tables from the AV schema to the current schema so that they may be altered.
-- * Adds new columns to dimension tables to support a second language.
-- * Populates new columns with German language values.
-- * Copies the SALES_FACT table from the AV schema to the current schema (just for convenience).
--
CREATE TABLE time_dim AS SELECT * FROM av.time_dim;
--
ALTER TABLE time_dim ADD month_name_de VARCHAR2(20);
ALTER TABLE time_dim ADD month_long_name_de VARCHAR2(20);
ALTER TABLE time_dim ADD season_de VARCHAR2(20);
--
UPDATE time_dim SET season_de = 'Winter' WHERE season = 'Winter';
UPDATE time_dim SET season_de = 'Frühling' WHERE season = 'Spring';
UPDATE time_dim SET season_de = 'Herbst' WHERE season = 'Fall';
UPDATE time_dim SET season_de = 'Sommer' WHERE season = 'Summer';
--
UPDATE time_dim SET month_name_de = 'Apr-11', month_long_name_de = 'April 2011' WHERE month_name = 'Apr-11';
UPDATE time_dim SET month_name_de = 'Apr-12', month_long_name_de = 'April 2012' WHERE month_name = 'Apr-12';
UPDATE time_dim SET month_name_de = 'Apr-13', month_long_name_de = 'April 2013' WHERE month_name = 'Apr-13';
UPDATE time_dim SET month_name_de = 'Apr-14', month_long_name_de = 'April 2014' WHERE month_name = 'Apr-14';
UPDATE time_dim SET month_name_de = 'Apr-15', month_long_name_de = 'April 2015' WHERE month_name = 'Apr-15';
UPDATE time_dim SET month_name_de = 'Aug-11', month_long_name_de = 'August 2011' WHERE month_name = 'Aug-11';
UPDATE time_dim SET month_name_de = 'Aug-12', month_long_name_de = 'August 2012' WHERE month_name = 'Aug-12';
UPDATE time_dim SET month_name_de = 'Aug-13', month_long_name_de = 'August 2013' WHERE month_name = 'Aug-13';
UPDATE time_dim SET month_name_de = 'Aug-14', month_long_name_de = 'August 2014' WHERE month_name = 'Aug-14';
UPDATE time_dim SET month_name_de = 'Aug-15', month_long_name_de = 'August 2015' WHERE month_name = 'Aug-15';
UPDATE time_dim SET month_name_de = 'Dez-11', month_long_name_de = 'Dezember 2011' WHERE month_name = 'Dec-11';
UPDATE time_dim SET month_name_de = 'Dez-12', month_long_name_de = 'Dezember 2012' WHERE month_name = 'Dec-12';
UPDATE time_dim SET month_name_de = 'Dez-13', month_long_name_de = 'Dezember 2013' WHERE month_name = 'Dec-13';
UPDATE time_dim SET month_name_de = 'Dez-14', month_long_name_de = 'Dezember 2014' WHERE month_name = 'Dec-14';
UPDATE time_dim SET month_name_de = 'Dez-15', month_long_name_de = 'Dezember 2015' WHERE month_name = 'Dec-15';
UPDATE time_dim SET month_name_de = 'Feb-11', month_long_name_de = 'Februar 2011' WHERE month_name = 'Feb-11';
UPDATE time_dim SET month_name_de = 'Feb-12', month_long_name_de = 'Februar 2012' WHERE month_name = 'Feb-12';
UPDATE time_dim SET month_name_de = 'Feb-13', month_long_name_de = 'Februar 2013' WHERE month_name = 'Feb-13';
UPDATE time_dim SET month_name_de = 'Feb-14', month_long_name_de = 'Februar 2014' WHERE month_name = 'Feb-14';
UPDATE time_dim SET month_name_de = 'Feb-15', month_long_name_de = 'Februar 2015' WHERE month_name = 'Feb-15';
UPDATE time_dim SET month_name_de = 'Jän-11', month_long_name_de = 'Januar 2011' WHERE month_name = 'Jan-11';
UPDATE time_dim SET month_name_de = 'Jän-12', month_long_name_de = 'Januar 2012' WHERE month_name = 'Jan-12';
UPDATE time_dim SET month_name_de = 'Jän-13', month_long_name_de = 'Januar 2013' WHERE month_name = 'Jan-13';
UPDATE time_dim SET month_name_de = 'Jän-14', month_long_name_de = 'Januar 2014' WHERE month_name = 'Jan-14';
UPDATE time_dim SET month_name_de = 'Jän-15', month_long_name_de = 'Januar 2015' WHERE month_name = 'Jan-15';
UPDATE time_dim SET month_name_de = 'Juli-11', month_long_name_de = 'Juli 2011' WHERE month_name = 'Jul-11';
UPDATE time_dim SET month_name_de = 'Juli-12', month_long_name_de = 'Juli 2012' WHERE month_name = 'Jul-12';
UPDATE time_dim SET month_name_de = 'Juli-13', month_long_name_de = 'Juli 2013' WHERE month_name = 'Jul-13';
UPDATE time_dim SET month_name_de = 'Juli-14', month_long_name_de = 'Juli 2014' WHERE month_name = 'Jul-14';
UPDATE time_dim SET month_name_de = 'Juli-15', month_long_name_de = 'Juli 2015' WHERE month_name = 'Jul-15';
UPDATE time_dim SET month_name_de = 'Juni-11', month_long_name_de = 'Juni 2011' WHERE month_name = 'Jun-11';
UPDATE time_dim SET month_name_de = 'Juni-12', month_long_name_de = 'Juni 2012' WHERE month_name = 'Jun-12';
UPDATE time_dim SET month_name_de = 'Juni-13', month_long_name_de = 'Juni 2013' WHERE month_name = 'Jun-13';
UPDATE time_dim SET month_name_de = 'Juni-14', month_long_name_de = 'Juni 2014' WHERE month_name = 'Jun-14';
UPDATE time_dim SET month_name_de = 'Juni-15', month_long_name_de = 'Juni 2015' WHERE month_name = 'Jun-15';
UPDATE time_dim SET month_name_de = 'März-11', month_long_name_de = 'März 2011' WHERE month_name = 'Mar-11';
UPDATE time_dim SET month_name_de = 'März-12', month_long_name_de = 'März 2012' WHERE month_name = 'Mar-12';
UPDATE time_dim SET month_name_de = 'März-13', month_long_name_de = 'März 2013' WHERE month_name = 'Mar-13';
UPDATE time_dim SET month_name_de = 'März-14', month_long_name_de = 'März 2014' WHERE month_name = 'Mar-14';
UPDATE time_dim SET month_name_de = 'März-15', month_long_name_de = 'März 2015' WHERE month_name = 'Mar-15';
UPDATE time_dim SET month_name_de = 'Mai-11', month_long_name_de = 'Mai 2011' WHERE month_name = 'May-11';
UPDATE time_dim SET month_name_de = 'Mai-12', month_long_name_de = 'Mai 2012' WHERE month_name = 'May-12';
UPDATE time_dim SET month_name_de = 'Mai-13', month_long_name_de = 'Mai 2013' WHERE month_name = 'May-13';
UPDATE time_dim SET month_name_de = 'Mai-14', month_long_name_de = 'Mai 2014' WHERE month_name = 'May-14';
UPDATE time_dim SET month_name_de = 'Mai-15', month_long_name_de = 'Mai 2015' WHERE month_name = 'May-15';
UPDATE time_dim SET month_name_de = 'Nov-11', month_long_name_de = 'November 2011' WHERE month_name = 'Nov-11';
UPDATE time_dim SET month_name_de = 'Nov-12', month_long_name_de = 'November 2012' WHERE month_name = 'Nov-12';
UPDATE time_dim SET month_name_de = 'Nov-13', month_long_name_de = 'November 2013' WHERE month_name = 'Nov-13';
UPDATE time_dim SET month_name_de = 'Nov-14', month_long_name_de = 'November 2014' WHERE month_name = 'Nov-14';
UPDATE time_dim SET month_name_de = 'Nov-15', month_long_name_de = 'November 2015' WHERE month_name = 'Nov-15';
UPDATE time_dim SET month_name_de = 'Okt-11', month_long_name_de = 'Oktober 2011' WHERE month_name = 'Oct-11';
UPDATE time_dim SET month_name_de = 'Okt-12', month_long_name_de = 'Oktober 2012' WHERE month_name = 'Oct-12';
UPDATE time_dim SET month_name_de = 'Okt-13', month_long_name_de = 'Oktober 2013' WHERE month_name = 'Oct-13';
UPDATE time_dim SET month_name_de = 'Okt-14', month_long_name_de = 'Oktober 2014' WHERE month_name = 'Oct-14';
UPDATE time_dim SET month_name_de = 'Okt-15', month_long_name_de = 'Oktober 2015' WHERE month_name = 'Oct-15';
UPDATE time_dim SET month_name_de = 'Sept-11', month_long_name_de = 'September 2011' WHERE month_name = 'Sep-11';
UPDATE time_dim SET month_name_de = 'Sept-12', month_long_name_de = 'September 2012' WHERE month_name = 'Sep-12';
UPDATE time_dim SET month_name_de = 'Sept-13', month_long_name_de = 'September 2013' WHERE month_name = 'Sep-13';
UPDATE time_dim SET month_name_de = 'Sept-14', month_long_name_de = 'September 2014' WHERE month_name = 'Sep-14';
UPDATE time_dim SET month_name_de = 'Sept-15', month_long_name_de = 'September 2015' WHERE month_name = 'Sep-15';
--
CREATE TABLE product_dim AS SELECT * FROM av.product_dim;
--
ALTER TABLE product_dim ADD department_name_de VARCHAR2(50);
ALTER TABLE product_dim ADD category_name_de VARCHAR2(50);
--
UPDATE product_dim SET category_name_de = 'Gesamte iPlayer-Familie', department_name_de = 'Tragbare Musik und Video' WHERE category_name = 'Total iPlayer Family';
UPDATE product_dim SET category_name_de = 'Camcorder und Zubehör', department_name_de = 'Gesamtserver-Computer' WHERE category_name = 'Camcorders and Accessories';
UPDATE product_dim SET category_name_de = 'Alle Computer-Möbel', department_name_de = 'Computer' WHERE category_name = 'All Computer Furniture';
UPDATE product_dim SET category_name_de = 'Computer Drucker und Zubehör', department_name_de = 'Computer' WHERE category_name = 'Computer Printers and Supplies';
UPDATE product_dim SET category_name_de = 'Insgesamt Personal Computer', department_name_de = 'Computer' WHERE category_name = 'Total Personal Computers';
UPDATE product_dim SET category_name_de = 'Kameras und Zubehör', department_name_de = 'Gesamtserver-Computer' WHERE category_name = 'Cameras and Accessories';
UPDATE product_dim SET category_name_de = 'PDAs', department_name_de = 'Computer' WHERE category_name = 'PDAs';
UPDATE product_dim SET category_name_de = 'Gesamtserver-Computer', department_name_de = 'Computer' WHERE category_name = 'Total Server Computers';
UPDATE product_dim SET category_name_de = 'Gesamte iPlayer-Familie', department_name_de = 'Tragbare Musik und Video' WHERE category_name = 'Total iPlayer Family';
UPDATE product_dim SET category_name_de = 'Camcorder und Zubehör', department_name_de = 'Gesamtserver-Computer' WHERE category_name = 'Camcorders and Accessories';
UPDATE product_dim SET category_name_de = 'Alle Computer-Möbel', department_name_de = 'Computer' WHERE category_name = 'All Computer Furniture';
UPDATE product_dim SET category_name_de = 'Computer Drucker und Zubehör', department_name_de = 'Computer' WHERE category_name = 'Computer Printers and Supplies';
UPDATE product_dim SET category_name_de = 'Insgesamt Personal Computer', department_name_de = 'Computer' WHERE category_name = 'Total Personal Computers';
UPDATE product_dim SET category_name_de = 'Kameras und Zubehör', department_name_de = 'Gesamtserver-Computer' WHERE category_name = 'Cameras and Accessories';
UPDATE product_dim SET category_name_de = 'PDAs', department_name_de = 'Computer' WHERE category_name = 'PDAs';
UPDATE product_dim SET category_name_de = 'Gesamtserver-Computer', department_name_de = 'Computer' WHERE category_name = 'Total Server Computers';
--
CREATE TABLE geography_dim AS SELECT * FROM av.geography_dim;
--
ALTER TABLE geography_dim ADD region_name_de VARCHAR2(20);
ALTER TABLE geography_dim ADD country_name_de VARCHAR2(30);
--
UPDATE geography_dim SET country_name_de = 'Afghanistan', region_name_de = 'Asien' WHERE country_name = 'Afghanistan';
UPDATE geography_dim SET country_name_de = 'Angola', region_name_de = 'Afrika' WHERE country_name = 'Angola';
UPDATE geography_dim SET country_name_de = 'Argentinien', region_name_de = 'Südamerika' WHERE country_name = 'Argentina';
UPDATE geography_dim SET country_name_de = 'Armenien', region_name_de = 'Asien' WHERE country_name = 'Armenia';
UPDATE geography_dim SET country_name_de = 'Australien', region_name_de = 'Europa' WHERE country_name = 'Austria';
UPDATE geography_dim SET country_name_de = 'Bangladesch', region_name_de = 'Asien' WHERE country_name = 'Bangladesh';
UPDATE geography_dim SET country_name_de = 'Weißrussland', region_name_de = 'Asien' WHERE country_name = 'Belarus';
UPDATE geography_dim SET country_name_de = 'Brasilien', region_name_de = 'Südamerika' WHERE country_name = 'Brazil';
UPDATE geography_dim SET country_name_de = 'Kamerun', region_name_de = 'Afrika' WHERE country_name = 'Cameroon';
UPDATE geography_dim SET country_name_de = 'Kanada', region_name_de = 'Nordamerika' WHERE country_name = 'Canada';
UPDATE geography_dim SET country_name_de = 'Chile', region_name_de = 'Südamerika' WHERE country_name = 'Chile';
UPDATE geography_dim SET country_name_de = 'China', region_name_de = 'Asien' WHERE country_name = 'China';
UPDATE geography_dim SET country_name_de = 'Kolumbien', region_name_de = 'Südamerika' WHERE country_name = 'Colombia';
UPDATE geography_dim SET country_name_de = 'Kongo', region_name_de = 'Afrika' WHERE country_name = 'Congo';
UPDATE geography_dim SET country_name_de = 'Kuba', region_name_de = 'Nordamerika' WHERE country_name = 'Cuba';
UPDATE geography_dim SET country_name_de = 'Ecuador', region_name_de = 'Südamerika' WHERE country_name = 'Ecuador';
UPDATE geography_dim SET country_name_de = 'Ägypten', region_name_de = 'Afrika' WHERE country_name = 'Egypt';
UPDATE geography_dim SET country_name_de = 'El Salavor', region_name_de = 'Südamerika' WHERE country_name = 'El Salvador';
UPDATE geography_dim SET country_name_de = 'Äthiopien', region_name_de = 'Afrika' WHERE country_name = 'Ethiopia';
UPDATE geography_dim SET country_name_de = 'Finnland', region_name_de = 'Europa' WHERE country_name = 'Finland';
UPDATE geography_dim SET country_name_de = 'Frankreich', region_name_de = 'Europa' WHERE country_name = 'France';
UPDATE geography_dim SET country_name_de = 'Deutchland', region_name_de = 'Europa' WHERE country_name = 'Germany';
UPDATE geography_dim SET country_name_de = 'Ghana', region_name_de = 'Afrika' WHERE country_name = 'Ghana';
UPDATE geography_dim SET country_name_de = 'Griechenland', region_name_de = 'Europa' WHERE country_name = 'Greece';
UPDATE geography_dim SET country_name_de = 'Honduras', region_name_de = 'Südamerika' WHERE country_name = 'Honduras';
UPDATE geography_dim SET country_name_de = 'Ungarn', region_name_de = 'Europa' WHERE country_name = 'Hungary';
UPDATE geography_dim SET country_name_de = 'Indien', region_name_de = 'Asien' WHERE country_name = 'India';
UPDATE geography_dim SET country_name_de = 'Indonesien', region_name_de = 'Asien' WHERE country_name = 'Indonesia';
UPDATE geography_dim SET country_name_de = 'Israel', region_name_de = 'Asien' WHERE country_name = 'Isreal';
UPDATE geography_dim SET country_name_de = 'Italien', region_name_de = 'Europa' WHERE country_name = 'Italy';
UPDATE geography_dim SET country_name_de = 'Japan', region_name_de = 'Asien' WHERE country_name = 'Japan';
UPDATE geography_dim SET country_name_de = 'Jordan', region_name_de = 'Asien' WHERE country_name = 'Jordan';
UPDATE geography_dim SET country_name_de = 'Kasachstan', region_name_de = 'Asien' WHERE country_name = 'Kazakhstan';
UPDATE geography_dim SET country_name_de = 'Kenia', region_name_de = 'Afrika' WHERE country_name = 'Kenya';
UPDATE geography_dim SET country_name_de = 'Madagaskar', region_name_de = 'Afrika' WHERE country_name = 'Madagascar';
UPDATE geography_dim SET country_name_de = 'Malaysia', region_name_de = 'Asien' WHERE country_name = 'Malaysia';
UPDATE geography_dim SET country_name_de = 'Mali', region_name_de = 'Afrika' WHERE country_name = 'Mali';
UPDATE geography_dim SET country_name_de = 'Mexiko', region_name_de = 'Nordamerika' WHERE country_name = 'Mexico';
UPDATE geography_dim SET country_name_de = 'Mosambik', region_name_de = 'Afrika' WHERE country_name = 'Mozambique';
UPDATE geography_dim SET country_name_de = 'Niederlande', region_name_de = 'Europa' WHERE country_name = 'Netherlands';
UPDATE geography_dim SET country_name_de = 'Neuseeland', region_name_de = 'Australien' WHERE country_name = 'New Zealand';
UPDATE geography_dim SET country_name_de = 'Nigeria', region_name_de = 'Afrika' WHERE country_name = 'Nigeria';
UPDATE geography_dim SET country_name_de = 'Pakistan', region_name_de = 'Asien' WHERE country_name = 'Pakistan';
UPDATE geography_dim SET country_name_de = 'Paraguay', region_name_de = 'Südamerika' WHERE country_name = 'Paraguay';
UPDATE geography_dim SET country_name_de = 'Peru', region_name_de = 'Südamerika' WHERE country_name = 'Peru';
UPDATE geography_dim SET country_name_de = 'Polen', region_name_de = 'Europa' WHERE country_name = 'Poland';
UPDATE geography_dim SET country_name_de = 'Portugal', region_name_de = 'Europa' WHERE country_name = 'Portugal';
UPDATE geography_dim SET country_name_de = 'Rumänien', region_name_de = 'Europa' WHERE country_name = 'Romania';
UPDATE geography_dim SET country_name_de = 'Russland', region_name_de = 'Asien' WHERE country_name = 'Russian Federation';
UPDATE geography_dim SET country_name_de = 'Saudi-Arabien', region_name_de = 'Asien' WHERE country_name = 'Saudi Arabia';
UPDATE geography_dim SET country_name_de = 'Senegal', region_name_de = 'Afrika' WHERE country_name = 'Senegal';
UPDATE geography_dim SET country_name_de = 'Serbien', region_name_de = 'Europa' WHERE country_name = 'Serbia';
UPDATE geography_dim SET country_name_de = 'Singapur', region_name_de = 'Asien' WHERE country_name = 'Singapore';
UPDATE geography_dim SET country_name_de = 'Somalia', region_name_de = 'Afrika' WHERE country_name = 'Somalia';
UPDATE geography_dim SET country_name_de = 'Südkorea', region_name_de = 'Asien' WHERE country_name = 'South Korea';
UPDATE geography_dim SET country_name_de = 'Thailand', region_name_de = 'Asien' WHERE country_name = 'Thailand';
UPDATE geography_dim SET country_name_de = 'Türkei', region_name_de = 'Asien' WHERE country_name = 'Turkey';
UPDATE geography_dim SET country_name_de = 'Ukraine', region_name_de = 'Asien' WHERE country_name = 'Ukraine';
UPDATE geography_dim SET country_name_de = 'Vereinigtes Königreich', region_name_de = 'Europa' WHERE country_name = 'United Kingdom';
UPDATE geography_dim SET country_name_de = 'Vereinigte Staaten', region_name_de = 'Nordamerika' WHERE country_name = 'United States';
UPDATE geography_dim SET country_name_de = 'Uruguay', region_name_de = 'Südamerika' WHERE country_name = 'Uruguay';
UPDATE geography_dim SET country_name_de = 'Usbekistan', region_name_de = 'Asien' WHERE country_name = 'Uzbekistan';
UPDATE geography_dim SET country_name_de = 'Venezuela', region_name_de = 'Südamerika' WHERE country_name = 'Venezuela';
UPDATE geography_dim SET country_name_de = 'Sambia', region_name_de = 'Afrika' WHERE country_name = 'Zambia';
--
COMMIT;
--
CREATE TABLE sales_fact AS SELECT * FROM av.sales_fact;
Analytic views provide a logical dimension model, mappings to physical tables and views that may be queried by applications using SQL. They provide an easy method to extend a star schema with structural and descriptive metadata, aggregate level data and measures calculations. Analytic views present aggregate data and measure calculations as pre-joined and pre-solved rows and columns, simplifying the SQL that needs to be generated by business intelligence applications.
The logical dimensional model includes structural elements such as attributes, hierarchies and measures and descriptive elements such as 'friendly' display names that can be used to represent the model to end users. For example, a hierarchy named GEOGRAPHY_HIER might be represented to a business user as 'Geography'.
The mappings to physical tables include mappings to columns uses as keys (key attributes)for data are various levels of aggregation and typically including mappings to columns that provide 'friendly' names for hierarchy values. For example a key attribute might be mapped to integer key values and descriptive attributes might be mapped to a column with text values.
Analytic views provide support using multiple languages with both the descriptive elements of the model and mappings to descriptive elements, providing business users with a reporting experience in their native or preferred language.
This tutorial will add German language support to an analytic view that uses English as the default language.
If you have not already done so, run the setup script for this tutorial by clicking on Execute the SQL required for this tutorial link which precedes the list of modules in this tutorial. This script will:
The dimension tables include columns for both English and German language data values that can be used as descriptive labels in hierarchies. The German language column names can be identified by the _DE suffix.
View the values in the TIME_DIM table.
SELECT * FROM time_dim ORDER BY month_end_date;
Note that descriptive columns for months are available in English and German.
View the values in the PRODUCT_DIM table.
SELECT * FROM product_dim;
View the values in the GEOGRAPHY_DIM table.
SELECT * FROM geography_dim;
The _ID columns are used as keys and are joined to the fact table. No changes to the to fact table are needed for support additional languages.
SELECT * FROM sales_fact WHERE rownum <= 10;
We will start by defining an attribute dimension and hierarchy with support for only a default language and then add support for German.
If support is not added to analytic view objects for specific languages, the classifications and descriptive labels of hierarchy values will be used for all users regardless of the NLS_LANGUAGE setting of the session.
The following attribute dimension and hierarchy objects do not include support for multiple languages. Note that CLASSIFICATIONs do not include a language keyword and only one column is mapped to each MEMBER_NAME, MEMBER_CAPTION and MEMBER_DESCRIPTION property of the levels.
Create the attribute dimension for Time.
CREATE OR REPLACE ATTRIBUTE DIMENSION time_attr_dim
CLASSIFICATION caption VALUE 'Time Attribute Dimension'
CLASSIFICATION description VALUE 'Company standard time attributes and levels'
USING time_dim
ATTRIBUTES
(year_id
CLASSIFICATION caption VALUE 'Year Key Value'
CLASSIFICATION description VALUE 'Year Key Value',
year_name
CLASSIFICATION caption VALUE 'Year Descriptive Value'
CLASSIFICATION description VALUE 'Year Descriptive Value',
quarter_id
CLASSIFICATION caption VALUE 'Quarter Key Value'
CLASSIFICATION description VALUE 'Quarter Key Value',
quarter_name
CLASSIFICATION caption VALUE 'Quarter Descriptive Value'
CLASSIFICATION description VALUE 'Quarter Descriptive Value',
month_id
CLASSIFICATION caption VALUE 'Month Key Value'
CLASSIFICATION description VALUE 'Month Key Value',
month_name
CLASSIFICATION caption VALUE 'Month Short Descriptive Value'
CLASSIFICATION description VALUE 'Month Short Descriptive Value',
month_long_name
CLASSIFICATION caption VALUE 'Month Long Descriptive Value'
CLASSIFICATION description VALUE 'Month Long Descriptive Value',
month_end_date
CLASSIFICATION caption VALUE 'Ending Date of Month Key Value'
CLASSIFICATION description VALUE 'Ending Date of Month Key Value')
LEVEL MONTH
CLASSIFICATION caption VALUE 'Month Level'
CLASSIFICATION description VALUE 'Month Aggregate Groupings'
KEY month_id
MEMBER NAME month_name
MEMBER CAPTION month_name
MEMBER DESCRIPTION month_long_name
ORDER BY month_end_date
DETERMINES (quarter_id, month_end_date)
LEVEL QUARTER
CLASSIFICATION caption VALUE 'Quarter Level'
CLASSIFICATION description VALUE 'Quarter Aggregate Groupings'
KEY quarter_id
MEMBER NAME quarter_name
MEMBER CAPTION quarter_name
MEMBER DESCRIPTION quarter_name
ORDER BY MAX month_end_date
DETERMINES (year_id)
LEVEL YEAR
CLASSIFICATION caption VALUE 'Year Level'
CLASSIFICATION description VALUE 'Year Aggregate Groupings'
KEY year_id
MEMBER NAME year_name
MEMBER CAPTION year_name
MEMBER DESCRIPTION year_name
ORDER BY MAX month_end_date;
Create the hierarchy for Time.
CREATE OR REPLACE HIERARCHY time_hier
CLASSIFICATION caption VALUE 'Time'
CLASSIFICATION description VALUE 'Time Hierarchy'
USING time_attr_dim
(month CHILD OF
quarter CHILD OF
year);
The following dictionary queries return only one value for each classification and the LANGUAGE column is NULL.
SELECT * FROM user_attribute_dim_class;
SELECT * FROM user_attribute_dim_attr_class;
SELECT * FROM user_attribute_dim_lvl_class;
SELECT * FROM user_hier_class;
The MEMBER_NAME, MEMBER_CAPTION and MEMBER_DESCRIPTION columns return the same values regardless of the current NLS_LANGUAGE value.
Check the current NLS_LANGUAGE value.
SELECT sys_context('USERENV','LANGUAGE') FROM dual;
View the MEMBER_NAME columns in the TIME_HIER hierarchy at the Month level.
SELECT member_name, member_caption, member_description FROM time_hier WHERE level_name = 'MONTH';
Change the language in the current session to German.
ALTER SESSION SET nls_language = GERMAN;
Note the values of MEMBER_NAME are unchanged.
SELECT member_name, member_caption, member_description FROM time_hier WHERE level_name = 'MONTH';
Use the LANGUAGE keyword to specify a language for a CLASSIFICATION. When multiple language support is added to analytic view objects, the CLASSIFICATION is typically defined once without a language keyword to be used as the default and repeated with a language keyword to support additional languages.
The following attribute dimension includes classifications with support for German.
CREATE OR REPLACE ATTRIBUTE DIMENSION time_attr_dim
CLASSIFICATION caption VALUE 'Time Attribute Dimension'
CLASSIFICATION description VALUE 'Company standard time attributes and levels'
CLASSIFICATION caption VALUE 'Time Attribute Dimension' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Company standard time attributes and levels' LANGUAGE 'GERMAN'
USING time_dim
ATTRIBUTES
(year_id
CLASSIFICATION caption VALUE 'Year Key Value'
CLASSIFICATION description VALUE 'Year Key Value'
CLASSIFICATION caption VALUE 'Jahr-ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Jahr-ID-Wert' LANGUAGE 'GERMAN',
year_name
CLASSIFICATION caption VALUE 'Year Descriptive Value'
CLASSIFICATION description VALUE 'Year Descriptive Value'
CLASSIFICATION caption VALUE 'Jahr Text Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Jahr Text Wert' LANGUAGE 'GERMAN',
quarter_id
CLASSIFICATION caption VALUE 'Quarter Key Value'
CLASSIFICATION description VALUE 'Quarter Key Value'
CLASSIFICATION caption VALUE 'Viertel-ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Viertel-ID-Wert' LANGUAGE 'GERMAN',
quarter_name
CLASSIFICATION caption VALUE 'Quarter Descriptive Value'
CLASSIFICATION description VALUE 'Quarter Descriptive Value'
CLASSIFICATION caption VALUE 'Quarter Textwert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Quarter Textwert' LANGUAGE 'GERMAN',
month_id
CLASSIFICATION caption VALUE 'Month Key Value'
CLASSIFICATION description VALUE 'Month Key Value'
CLASSIFICATION caption VALUE 'Monatlicher ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Monatlicher ID-Wert' LANGUAGE 'GERMAN',
month_name
CLASSIFICATION caption VALUE 'Month Short Descriptive Value'
CLASSIFICATION description VALUE 'Month Short Descriptive Value'
CLASSIFICATION caption VALUE 'Text des kurzen Monats' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Text des kurzen Monats' LANGUAGE 'GERMAN',
month_long_name
CLASSIFICATION caption VALUE 'Month Long Descriptive Value'
CLASSIFICATION description VALUE 'Month Long Descriptive Value'
CLASSIFICATION caption VALUE 'Text des langen Monats' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Text des langen Monats' LANGUAGE 'GERMAN',
month_end_date
CLASSIFICATION caption VALUE 'Ending Date of Month Key Value'
CLASSIFICATION description VALUE 'Ending Date of Month Key Value'
CLASSIFICATION caption VALUE 'Enddatum des Monats' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Enddatum des Monats' LANGUAGE 'GERMAN')
LEVEL MONTH
CLASSIFICATION caption VALUE 'Month Level'
CLASSIFICATION description VALUE 'Month Aggregate Groupings'
CLASSIFICATION caption VALUE 'Monatsebene' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Monat Aggregatgruppierung' LANGUAGE 'GERMAN'
KEY month_id
MEMBER NAME month_name
MEMBER CAPTION month_name
MEMBER DESCRIPTION month_long_name
ORDER BY month_end_date
DETERMINES (quarter_id, month_end_date)
LEVEL QUARTER
CLASSIFICATION caption VALUE 'Quarter Level'
CLASSIFICATION description VALUE 'Quarter Aggregate Groupings'
CLASSIFICATION caption VALUE 'Viertelniveau' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Quarter Aggregate Gruppierung' LANGUAGE 'GERMAN'
KEY quarter_id
MEMBER NAME quarter_name
MEMBER CAPTION quarter_name
MEMBER DESCRIPTION quarter_name
ORDER BY MAX month_end_date
DETERMINES (year_id)
LEVEL YEAR
CLASSIFICATION caption VALUE 'Year Level'
CLASSIFICATION description VALUE 'Year Aggregate Groupings'
CLASSIFICATION caption VALUE 'Jahresniveau' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Jahres-Aggregatgruppierung' LANGUAGE 'GERMAN'
KEY year_id
MEMBER NAME year_name
MEMBER CAPTION year_name
MEMBER DESCRIPTION year_name
ORDER BY MAX month_end_date;
The following hierarchy includes classifications with support for German.
CREATE OR REPLACE HIERARCHY time_hier
CLASSIFICATION caption VALUE 'Time'
CLASSIFICATION description VALUE 'Time Hierarchy'
CLASSIFICATION caption VALUE 'Zeit' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Zeithierarchie' LANGUAGE 'GERMAN'
USING time_attr_dim
(month CHILD OF
quarter CHILD OF
year);
Classifications are available from the data dictionary in both the default language and German.
SELECT * FROM user_attribute_dim_class;
SELECT * FROM user_attribute_dim_attr_class;
SELECT * FROM user_attribute_dim_lvl_class;
SELECT * FROM user_hier_class;
To map hierarchical attributes to different columns based on language:
The following attribute dimension includes hierarchical attributes at the Month level with support for German.
CREATE OR REPLACE ATTRIBUTE DIMENSION time_attr_dim
CLASSIFICATION caption VALUE 'Time Attribute Dimension'
CLASSIFICATION description VALUE 'Company standard time attributes and levels'
CLASSIFICATION caption VALUE 'Time Attribute Dimension' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Company standard time attributes and levels' LANGUAGE 'GERMAN'
USING time_dim
ATTRIBUTES
(year_id
CLASSIFICATION caption VALUE 'Year Key Value'
CLASSIFICATION description VALUE 'Year Key Value'
CLASSIFICATION caption VALUE 'Jahr-ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Jahr-ID-Wert' LANGUAGE 'GERMAN',
year_name
CLASSIFICATION caption VALUE 'Year Descriptive Value'
CLASSIFICATION description VALUE 'Year Descriptive Value'
CLASSIFICATION caption VALUE 'Jahr Text Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Jahr Text Wert' LANGUAGE 'GERMAN',
quarter_id
CLASSIFICATION caption VALUE 'Quarter Key Value'
CLASSIFICATION description VALUE 'Quarter Key Value'
CLASSIFICATION caption VALUE 'Viertel-ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Viertel-ID-Wert' LANGUAGE 'GERMAN',
quarter_name
CLASSIFICATION caption VALUE 'Quarter Descriptive Value'
CLASSIFICATION description VALUE 'Quarter Descriptive Value'
CLASSIFICATION caption VALUE 'Quarter Textwert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Quarter Textwert' LANGUAGE 'GERMAN',
month_id
CLASSIFICATION caption VALUE 'Month Key Value'
CLASSIFICATION description VALUE 'Month Key Value'
CLASSIFICATION caption VALUE 'Monatlicher ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Monatlicher ID-Wert' LANGUAGE 'GERMAN',
month_name
CLASSIFICATION caption VALUE 'Month Short Descriptive Value'
CLASSIFICATION description VALUE 'Month Short Descriptive Value'
CLASSIFICATION caption VALUE 'Text des kurzen Monats' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Text des kurzen Monats' LANGUAGE 'GERMAN',
month_long_name
CLASSIFICATION caption VALUE 'Month Long Descriptive Value'
CLASSIFICATION description VALUE 'Month Long Descriptive Value'
CLASSIFICATION caption VALUE 'Text des langen Monats' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Text des langen Monats' LANGUAGE 'GERMAN',
month_name_de
CLASSIFICATION caption VALUE 'Month Short Descriptive Value'
CLASSIFICATION description VALUE 'Month Short Descriptive Value'
CLASSIFICATION caption VALUE 'Text des kurzen Monats' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Text des kurzen Monats' LANGUAGE 'GERMAN',
month_long_name_de
CLASSIFICATION caption VALUE 'Month Long Descriptive Value'
CLASSIFICATION description VALUE 'Month Long Descriptive Value'
CLASSIFICATION caption VALUE 'Text des langen Monats' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Text des langen Monats' LANGUAGE 'GERMAN',
month_end_date
CLASSIFICATION caption VALUE 'Ending Date of Month Key Value'
CLASSIFICATION description VALUE 'Ending Date of Month Key Value'
CLASSIFICATION caption VALUE 'Enddatum des Monats' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Enddatum des Monats' LANGUAGE 'GERMAN')
LEVEL MONTH
CLASSIFICATION caption VALUE 'Month Level'
CLASSIFICATION description VALUE 'Month Aggregate Groupings'
CLASSIFICATION caption VALUE 'Monatsebene' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Monat Aggregatgruppierung' LANGUAGE 'GERMAN'
KEY month_id
MEMBER NAME
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN month_name_de
ELSE month_name
END
MEMBER CAPTION
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN month_name_de
ELSE month_name
END
MEMBER DESCRIPTION
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN month_long_name_de
ELSE month_long_name
END
ORDER BY month_end_date
DETERMINES (quarter_id, month_end_date)
LEVEL QUARTER
CLASSIFICATION caption VALUE 'Quarter Level'
CLASSIFICATION description VALUE 'Quarter Aggregate Groupings'
CLASSIFICATION caption VALUE 'Viertelniveau' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Quarter Aggregate Gruppierung' LANGUAGE 'GERMAN'
KEY quarter_id
MEMBER NAME quarter_name
MEMBER CAPTION quarter_name
MEMBER DESCRIPTION quarter_name
ORDER BY MAX month_end_date
DETERMINES (year_id)
LEVEL YEAR
CLASSIFICATION caption VALUE 'Year Level'
CLASSIFICATION description VALUE 'Year Aggregate Groupings'
CLASSIFICATION caption VALUE 'Jahresniveau' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Jahres-Aggregatgruppierung' LANGUAGE 'GERMAN'
KEY year_id
MEMBER NAME year_name
MEMBER CAPTION year_name
MEMBER DESCRIPTION year_name
ORDER BY MAX month_end_date;
No changes are required to the TIME_HIER hierarchy. The hierarchy will inherit the changes from the attribute dimension.
Set NLS_LANGUAGE = AMERICAN
ALTER SESSION SET nls_language = AMERICAN;
Select the MEMBER_NAME, MEMBER_CAPTION and MEMBER_DESCRIPTION attributes at the Month level
SELECT member_name,
member_caption,
member_description
FROM time_hier
WHERE level_name = 'MONTH';
Change the language in the current session to German.
ALTER SESSION SET nls_language = GERMAN;
Note the values of MEMBER_NAME are now returned from the attributes mapped to the _DE columns of the dimension table.
SELECT member_name,
member_caption,
member_description
FROM time_hier
WHERE level_name = 'MONTH';
Use the following statements to create additional attribute dimension and hierarchies with support for German.
Product attribute dimension.
CREATE OR REPLACE ATTRIBUTE DIMENSION product_attr_dim
CLASSIFICATION caption VALUE 'Product Attribute Dimension'
CLASSIFICATION description VALUE 'Product attributes and levels'
CLASSIFICATION caption VALUE 'Produkt-Attribute und Ebenen' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Produkt-Attribute und Ebenen' LANGUAGE 'GERMAN'
USING product_dim
ATTRIBUTES
(department_id
CLASSIFICATION caption VALUE 'Department Key Value'
CLASSIFICATION description VALUE 'Department Key Value'
CLASSIFICATION caption VALUE 'Abteilungs-ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Abteilungs-ID-Wert' LANGUAGE 'GERMAN',
department_name
CLASSIFICATION caption VALUE 'Department Text Value'
CLASSIFICATION description VALUE 'Department Text Value'
CLASSIFICATION caption VALUE 'Abteilung Text Wert (Englisch)' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Abteilung Text Wert (Englisch)' LANGUAGE 'GERMAN',
department_name_de
CLASSIFICATION caption VALUE 'Department Text Value (German)'
CLASSIFICATION description VALUE 'Department Text Value (German)'
CLASSIFICATION caption VALUE 'Abteilung Text Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Abteilung Text Wert' LANGUAGE 'GERMAN',
category_id
CLASSIFICATION caption VALUE 'Category Key Value'
CLASSIFICATION description VALUE 'Category Key Value'
CLASSIFICATION caption VALUE 'Kategorie-ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Kategorie-ID-Wert' LANGUAGE 'GERMAN',
category_name
CLASSIFICATION caption VALUE 'Category Text Value'
CLASSIFICATION description VALUE 'Category Text Value'
CLASSIFICATION caption VALUE 'Kategorien Text Wert (Englisch)' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Kategorien Text Wert (Englisch)' LANGUAGE 'GERMAN',
category_name_de
CLASSIFICATION caption VALUE 'Category Text Value (German)'
CLASSIFICATION description VALUE 'Category Text Value (German)'
CLASSIFICATION caption VALUE 'Kategorien Text Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Kategorien Text Wert' LANGUAGE 'GERMAN')
LEVEL DEPARTMENT
CLASSIFICATION caption VALUE 'Department'
CLASSIFICATION description VALUE 'Department Aggregate Grouping'
CLASSIFICATION caption VALUE 'Abteilungsebene' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Abteilung Aggregatgruppierung' LANGUAGE 'GERMAN'
KEY department_id
MEMBER NAME
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN department_name_de
ELSE department_name
END
MEMBER CAPTION
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN department_name_de
ELSE department_name
END
MEMBER DESCRIPTION
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN department_name_de
ELSE department_name
END
ORDER BY department_name
LEVEL CATEGORY
CLASSIFICATION caption VALUE 'Category'
CLASSIFICATION description VALUE 'Category Aggregate Grouping'
CLASSIFICATION caption VALUE 'Kategorien Ebene' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Kategorie Aggregatgruppierung' LANGUAGE 'GERMAN'
KEY category_id
MEMBER NAME
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN category_name_de
ELSE category_name
END
MEMBER CAPTION
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN category_name_de
ELSE category_name
END
MEMBER DESCRIPTION
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN category_name_de
ELSE category_name
END
ORDER BY category_name
DETERMINES(department_id)
ALL MEMBER NAME 'ALL PRODUCTS';
Product hierarchy.
CREATE OR REPLACE HIERARCHY product_hier
CLASSIFICATION caption VALUE 'Product Hierarchy'
CLASSIFICATION description VALUE 'Product Hierarchy'
CLASSIFICATION caption VALUE 'Produkthierarchie' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Produkthierarchie' LANGUAGE 'GERMAN'
USING product_attr_dim
(CATEGORY
CHILD OF department);
Geography attribute dimension. Note that German is available in the dimension table for only the Region and Country levels.
CREATE OR REPLACE ATTRIBUTE DIMENSION geography_attr_dim
CLASSIFICATION caption VALUE 'Geography Attribute Dimension'
CLASSIFICATION description VALUE 'Geography attributes and levels'
CLASSIFICATION caption VALUE 'Erdkunde-Attribute und Ebenen' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Erdkunde-Attribute und Ebenen' LANGUAGE 'GERMAN'
USING geography_dim
ATTRIBUTES
(region_id
CLASSIFICATION caption VALUE 'Region Key Value'
CLASSIFICATION description VALUE 'Region Key Value'
CLASSIFICATION caption VALUE 'Region-ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Region-ID-Wert' LANGUAGE 'GERMAN',
region_name
CLASSIFICATION caption VALUE 'Region Text Value'
CLASSIFICATION description VALUE 'Region Text Value'
CLASSIFICATION caption VALUE 'Region-Text-Wert (Englisch)' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Region-Text-Wert (Englisch)' LANGUAGE 'GERMAN',
region_name_de
CLASSIFICATION caption VALUE 'Region Text Value (German)'
CLASSIFICATION description VALUE 'Region Text Value (German)'
CLASSIFICATION caption VALUE 'Region-Text-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Region-Text-Wert' LANGUAGE 'GERMAN',
country_id
CLASSIFICATION caption VALUE 'Country Key Value'
CLASSIFICATION description VALUE 'Country Key Value'
CLASSIFICATION caption VALUE 'Land-ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Land-ID-Wert' LANGUAGE 'GERMAN',
country_name
CLASSIFICATION caption VALUE 'Country Text Value'
CLASSIFICATION description VALUE 'Country Text Value'
CLASSIFICATION caption VALUE 'Land-Text-Wert (Englisch)' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Land-Text-Wert (Englisch)' LANGUAGE 'GERMAN',
country_name_de
CLASSIFICATION caption VALUE 'Country Text Value (German)'
CLASSIFICATION description VALUE 'Country Text Value (German)'
CLASSIFICATION caption VALUE 'Land-Text-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Land-Text-Wert' LANGUAGE 'GERMAN',
state_province_id
CLASSIFICATION caption VALUE 'State/Province Key Value'
CLASSIFICATION description VALUE 'State/Province Key Value'
CLASSIFICATION caption VALUE 'aBundesland-ID-Wert' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Bundesland-ID-Wert' LANGUAGE 'GERMAN',
state_province_name
CLASSIFICATION caption VALUE 'State/Province Text Value'
CLASSIFICATION description VALUE 'State/Province Text Value'
CLASSIFICATION caption VALUE 'Bundesland-Text-Wert (Englisch)' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Bundesland-Text-Wert (Englisch)' LANGUAGE 'GERMAN'
)
LEVEL REGION
KEY region_id
ALTERNATE KEY region_name
MEMBER NAME
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN region_name_de
ELSE region_name
END
MEMBER CAPTION
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN region_name_de
ELSE region_name
END
MEMBER DESCRIPTION
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN region_name_de
ELSE region_name
END
ORDER BY region_name
LEVEL COUNTRY
KEY country_id
MEMBER NAME
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN country_name_de
ELSE country_name
END
MEMBER CAPTION
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN country_name_de
ELSE country_name
END
MEMBER DESCRIPTION
CASE
WHEN sys_context('USERENV','LANGUAGE') LIKE 'GERMAN%'
THEN country_name_de
ELSE country_name
END
ORDER BY country_name
DETERMINES(region_id)
LEVEL STATE_PROVINCE
KEY state_province_id
-- Note: State/Province names only provided in English.
MEMBER NAME state_province_name
MEMBER CAPTION state_province_name
MEMBER DESCRIPTION state_province_name
ORDER BY state_province_name
DETERMINES(country_id)
ALL MEMBER NAME 'ALL CUSTOMERS';
Geography hierarchy.
CREATE OR REPLACE HIERARCHY geography_hier
CLASSIFICATION caption VALUE 'Geography Hierarchy'
CLASSIFICATION description VALUE 'Geography Hierarchy'
CLASSIFICATION caption VALUE 'Geographische Hierarchie' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Geographische Hierarchie' LANGUAGE 'GERMAN'
USING geography_attr_dim
(state_province
CHILD OF country
CHILD OF region);
Set NLS_LANGUAGE = AMERICAN
ALTER SESSION SET nls_language = AMERICAN;
Query attributes and hierarchical attributes from the PRODUCT_HIER hierarchy. Note that both English and German are available from attributes and the hierarchical attributes return English values.
SELECT
department_name,
category_name,
department_name_de,
category_name_de,
member_name,
member_caption,
member_description
FROM product_hier
WHERE level_name = 'CATEGORY'
;
Set NLS_LANGUAGE = GERMAN
ALTER SESSION SET nls_language = GERMAN;
Query attributes and hierarchical attributes from the PRODUCT_HIER hierarchy. Note that the attributes continue to return English and German values and the hierarchical attributes now return German values.
SELECT
department_name,
category_name,
department_name_de,
category_name_de,
member_name,
member_caption,
member_description
FROM product_hier
WHERE level_name = 'CATEGORY'
;The analytic view inherits attributes from hierarchies so only the classifications need to be updated to support German.
CREATE OR REPLACE ANALYTIC VIEW sales_av with default and German classifications.
CREATE OR REPLACE ANALYTIC VIEW sales_av
USING sales_fact
DIMENSION BY
(time_attr_dim
KEY month_id REFERENCES month_id
HIERARCHIES (
time_hier DEFAULT),
product_attr_dim
KEY category_id REFERENCES category_id
HIERARCHIES (
product_hier DEFAULT),
geography_attr_dim
KEY state_province_id
REFERENCES state_province_id
HIERARCHIES (
geography_hier DEFAULT)
)
MEASURES
(sales FACT sales
CLASSIFICATION caption VALUE 'Sales Analytic View'
CLASSIFICATION description VALUE 'Sales Analytic View'
CLASSIFICATION caption VALUE 'Vertrieb Analytische Sicht' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Vertrieb Analytische Sicht' LANGUAGE 'GERMAN',
sales_year_ago AS (LAG(sales) OVER (HIERARCHY time_hier OFFSET 1 ACROSS ANCESTOR AT LEVEL year))
CLASSIFICATION caption VALUE 'Sales Analytic View'
CLASSIFICATION description VALUE 'Sales Analytic View'
CLASSIFICATION caption VALUE 'Vertrieb Analytische Sicht' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Vertrieb Analytische Sicht' LANGUAGE 'GERMAN',
units FACT units
CLASSIFICATION caption VALUE 'Units Sold'
CLASSIFICATION description VALUE 'Units Sold'
CLASSIFICATION caption VALUE 'Verkäufe vor einem Jahr' LANGUAGE 'GERMAN'
CLASSIFICATION description VALUE 'Verkäufe vor einem Jahr' LANGUAGE 'GERMAN'
)
DEFAULT MEASURE SALES;
Set NLS_LANGUAGE = AMERICAN
ALTER SESSION SET nls_language = AMERICAN;
Run a query against the analytic view.
SELECT time_hier.member_name AS Time,
product_hier.member_name AS Product,
geography_hier.member_name AS Geography,
sales,
sales_year_ago
FROM
sales_av HIERARCHIES (time_hier, product_hier, geography_hier)
WHERE time_hier.level_name in ('YEAR')
AND product_hier.level_name in ('DEPARTMENT')
AND geography_hier.level_name in ('REGION')
AND time_hier.member_name in ('CY2014','CY2015')
ORDER BY time_hier.hier_order,
product_hier.hier_order,
geography_hier.hier_order;
Set NLS_LANGUAGE = GERMAN
ALTER SESSION SET nls_language = GERMAN;
Run the same query against the analytic view.
SELECT time_hier.member_name AS Time,
product_hier.member_name AS Product,
geography_hier.member_name AS Geography,
sales,
sales_year_ago
FROM
sales_av HIERARCHIES (time_hier, product_hier, geography_hier)
WHERE time_hier.level_name in ('YEAR')
AND product_hier.level_name in ('DEPARTMENT')
AND geography_hier.level_name in ('REGION')
AND time_hier.member_name in ('CY2014','CY2015')
ORDER BY time_hier.hier_order,
product_hier.hier_order,
geography_hier.hier_order;