Vyoms OneStopTesting.com - Testing EBooks, Tutorials, Articles, Jobs, Training Institutes etc.
OneStopGate.com - Gate EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopMBA.com - MBA EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopIAS.com - IAS EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopSAP.com - SAP EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopGRE.com - of GRE EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
Bookmark and Share Rss Feeds

Additional Calculations Exposed Through Automatic Views | Articles | Recent Articles | News Article | Interesting Articles | Technology Articles | Articles On Education | Articles On Corporate | Company Articles | College Articles | Articles on Recession
Sponsored Ads
Hot Jobs
Fresher Jobs
Experienced Jobs
Government Jobs
Walkin Jobs
Placement Section
Company Profiles
Interview Questions
Placement Papers
Resources @ VYOMS
Companies In India
Consultants In India
Colleges In India
Exams In India
Latest Results
Notifications In India
Call Centers In India
Training Institutes In India
Job Communities In India
Courses In India
Jobs by Keyskills
Jobs by Functional Areas
Learn @ VYOMS
GATE Preparation
GRE Preparation
GMAT Preparation
IAS Preparation
SAP Preparation
Testing Preparation
MBA Preparation
News @ VYOMS
Freshers News
Job Articles
Latest News
India News Network
Interview Ebook
Get 30,000+ Interview Questions & Answers in an eBook.
Interview Success Kit - Get Success in Job Interviews
  • 30,000+ Interview Questions
  • Most Questions Answered
  • 5 FREE Bonuses
  • Free Upgrades

VYOMS TOP EMPLOYERS

Wipro Technologies
Tata Consultancy Services
Accenture
IBM
Satyam
Genpact
Cognizant Technologies

Home » Articles » Additional Calculations Exposed Through Automatic Views

Additional Calculations Exposed Through Automatic Views








Article Posted On Date : Friday, May 22, 2009


Additional Calculations Exposed Through Automatic Views
Advertisements

HTML clipboard

Additional Calculations Exposed Through Automatic Views

You can use cubes in Oracle OLAP 11g as a summary management solution, but Oracle OLAP 11g really shines when you use it to perform calculations. Oracle OLAP can perform many calculations that can be difficult to express in SQL and time-consuming to perform with the standard relational engine.

Year-to-date and share calculations are good examples of calculations that perform better with Oracle OLAP. Once defined in the analytic workspace as calculated measures, these measures are exposed as extra columns in a view that is automatically created for a cube. You can then query these measures just as you would query any base measure from the cube view.

When working with cube views, bear in mind that the view contains preaggregated data at multiple levels. As a result, you do not need to include any aggregation functions such as SUM, and you generally do not need GROUP BY clauses. But you must also specify the level of data you want to select via the appropriate WHERE clause.

Enter the query in Listing 1 into Oracle SQL Developer (or your SQL tool of choice) to look at quarterly sales and see how those sales compare on a year-to-date basis with the same periods last year. The query also shows how to return multiple levels of the time dimension in one query.

Code Listing 1: Quarterly sales and comparison query

SELECT t.long_description time,            p.long_description product,            cu.long_description region,            ch.long_description channel,            ROUND(u.sales) SALES,            ROUND(u.sales_ytd) YTD,            ROUND(u.sales_ytd_dif_yrago) DIFF,            ROUND(u.sales_ytd_pct_dif_yrago, 6) PCT  FROM time_view t, product_view p, customer_view cu, channel_view ch, units_cube_view u  WHERE t.dim_key = u.time     AND p.dim_key = u.product     AND cu.dim_key = u.customer     AND ch.dim_key = u.channel     AND (t.level_name IN('CALENDAR_YEAR', 'CALENDAR_QUARTER')        OR t.time_calendar_quarter_id = 'CY1999.Q1')     AND p.level_name IN('CLASS', 'TOTAL')     AND cu.level_name = 'TOTAL'     AND ch.level_name = 'TOTAL'     AND p.dim_key = 'CLASS_SFT'  ORDER BY t.end_date, t.time_span;    Executing the query in Oracle SQL Developer returns the results shown in Figure 2. Note how rows  are returned for years, quarters, and three specified months�all in one view. 

 

figure 2
Figure 2: Quarterly and comparison results
 

This example shows only the most-basic calculations Oracle OLAP 11g can perform. A new calculated measure wizard in the analytic workspace manager enables you to calculate shares, indexes, ranks, moving aggregates, cumulative aggregates, and user-defined expressions. You can even calculate models, forecasts, and regressions.

Refreshing Cubes, Using Materialized Views

As fact tables acquire new data, Oracle Database must maintain cubes and recalculate totals. You can simplify this procedure by taking advantage of the materialized view refresh capability in Oracle Database. By checking the Enable Materialized View Refresh of the Cube check box (shown in Figure 1), you can specify the refresh of an analytic workspace to be the same as the refresh of any other materialized view. For example, to refresh the GLOBAL analytic workspace, use the following command:

dbms_mview.refresh('CB$UNIT_CUBE', 'F')

This command reloads the analytic workspace from the fact table and recalculates any aggregates that need updating. The mechanisms and syntax are exactly the same as with noncube materialized views, with methods for controlling aspects such as staleness and schedules. The materialized view logs identify which portions of the cube need reloading. Oracle OLAP then uses this information to reload and recalculate the appropriate portions of the cube.

Aggregation

Oracle OLAP always returns data as fully solved, but you have control over the extent to which the data is preaggregated. In Oracle OLAP 10g, you could specify which levels of the cube to preaggregate. That capability is still supported in Oracle OLAP 11g, but now you can also specify the percentage of the cube you want to preaggregate. Oracle OLAP will then figure out which areas of the cube to preaggregate and which areas to aggregate on the fly. Oracle OLAP figures out how to balance runtime performance against load performance and the time needed to calculate certain aggregates. Figure 3 shows a cube creation dialog box that specifies 20 percent preaggregation.

 

figure 3
Figure 3: Cube creation dialog box specifying 20 percent preaggregation
 

Presenting the Data

As with previous versions of Oracle OLAP, you can access Analytic Workspace cubes via the Java OLAP API. However, Oracle has positioned SQL as the language of choice for accessing data in Oracle OLAP cubes. With views automatically generated that return cube data via standard SQL, any application environment with a SQL interface can access data from cubes. As a result, Oracle OLAP data can be accessed by Oracle applications such as Oracle Business Intelligence Suite Enterprise Edition Plus, Oracle Discoverer, and Oracle Application Express. In addition, any other application development tool that uses SQL can also access Oracle OLAP data. As an example, Figure 4 shows an Oracle Business Intelligence Suite Enterprise Edition report running against the same Oracle OLAP cube data demonstrated in this article. Oracle OLAP provides all of the totals and computes the various calculations being displayed.

 

figure 4
Figure 4: Oracle Business Intelligence Suite Enterprise Edition accessing Oracle OLAP cube data


Other New Features

Other new features of Oracle OLAP 11g make it easier to work with analytic workspaces and further integrate OLAP into the database engine. There are new storage and partitioning advisors that simplify the process of designing cubes for optimal storage and maintenance. Furthermore, new data security policies make it easier to grant access to different portions of cubes to various users. A detailed discussion of these capabilities is beyond the scope of this article. For more information, see the Oracle OLAP 11g Release 1 (11.1) User's Guide.

Conclusion

With the enhanced capabilities in Oracle OLAP 11g, it is much easier to incorporate OLAP into the framework of a data warehouse. Key improvements such as materialized views, automatic view creation, and aggregation wizards make Oracle OLAP a compelling choice for accelerating query performance.






Sponsored Ads



Interview Questions
HR Interview Questions
Testing Interview Questions
SAP Interview Questions
Business Intelligence Interview Questions
Call Center Interview Questions

Databases

Clipper Interview Questions
DBA Interview Questions
Firebird Interview Questions
Hierarchical Interview Questions
Informix Interview Questions
Microsoft Access Interview Questions
MS SqlServer Interview Questions
MYSQL Interview Questions
Network Interview Questions
Object Relational Interview Questions
PL/SQL Interview Questions
PostgreSQL Interview Questions
Progress Interview Questions
Relational Interview Questions
SQL Interview Questions
SQL Server Interview Questions
Stored Procedures Interview Questions
Sybase Interview Questions
Teradata Interview Questions

Microsof Technologies

.Net Database Interview Questions
.Net Deployement Interview Questions
ADO.NET Interview Questions
ADO.NET 2.0 Interview Questions
Architecture Interview Questions
ASP Interview Questions
ASP.NET Interview Questions
ASP.NET 2.0 Interview Questions
C# Interview Questions
Csharp Interview Questions
DataGrid Interview Questions
DotNet Interview Questions
Microsoft Basics Interview Questions
Microsoft.NET Interview Questions
Microsoft.NET 2.0 Interview Questions
Share Point Interview Questions
Silverlight Interview Questions
VB.NET Interview Questions
VC++ Interview Questions
Visual Basic Interview Questions

Java / J2EE

Applet Interview Questions
Core Java Interview Questions
Eclipse Interview Questions
EJB Interview Questions
Hibernate Interview Questions
J2ME Interview Questions
J2SE Interview Questions
Java Interview Questions
Java Beans Interview Questions
Java Patterns Interview Questions
Java Security Interview Questions
Java Swing Interview Questions
JBOSS Interview Questions
JDBC Interview Questions
JMS Interview Questions
JSF Interview Questions
JSP Interview Questions
RMI Interview Questions
Servlet Interview Questions
Socket Programming Interview Questions
Springs Interview Questions
Struts Interview Questions
Web Sphere Interview Questions

Programming Languages

C Interview Questions
C++ Interview Questions
CGI Interview Questions
Delphi Interview Questions
Fortran Interview Questions
ILU Interview Questions
LISP Interview Questions
Pascal Interview Questions
Perl Interview Questions
PHP Interview Questions
Ruby Interview Questions
Signature Interview Questions
UML Interview Questions
VBA Interview Questions
Windows Interview Questions
Mainframe Interview Questions


Copyright © 2001-2024 Vyoms.com. All Rights Reserved. Home | About Us | Advertise With Vyoms.com | Jobs | Contact Us | Feedback | Link to Us | Privacy Policy | Terms & Conditions
Placement Papers | Get Your Free Website | IAS Preparation | C++ Interview Questions | C Interview Questions | Report a Bug | Romantic Shayari | CAT 2024

Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes

Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |


Copyright ©2001-2024 Vyoms.com, All Rights Reserved.
Disclaimer: VYOMS.com has taken all reasonable steps to ensure that information on this site is authentic. Applicants are advised to research bonafides of advertisers independently. VYOMS.com shall not have any responsibility in this regard.