Oracle Bi Solutions

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 4 November 2013

OBIEE11g - Custom BI Time Dimension Populate Database Script.

Posted on 00:33 by Unknown

1) Create database function to populate the time table in the database.

CREATE OR REPLACE PROCEDURE update_day_dim (start_date IN DATE, no_of_days IN NUMBER,Delete_data IN varchar2)
AS
   mcount   NUMBER;
   mdate    DATE;
BEGIN
if delete_data = 'Y' then
   delete from xx_bi_time_day_d;
   commit;
end if;
   BEGIN
      mcount := 1;
      mdate := start_date;

      FOR mcount IN 1 .. no_of_days
      LOOP
   
         INSERT INTO xx_bi_time_day_d
              VALUES (TO_CHAR (mdate, 'MM/DD/YYYY'), mdate
                    , TO_CHAR (mdate, 'DD'), TO_CHAR (mdate, 'Day')
                    , TO_CHAR (mdate, 'MM-YYYY'), TO_CHAR (mdate, 'MM')
                    , TO_CHAR (mdate, 'W'), 'W' || TO_CHAR (mdate, 'W')
                    , TO_CHAR (mdate, 'YYYY'), TO_CHAR (mdate, 'Q')
                    , 'Q' || TO_CHAR (mdate, 'Q'), TO_CHAR (mdate, 'Month')
                    , TO_CHAR (mdate, 'MM')
                    , DECODE (TO_CHAR (mdate, 'Q')
                            , '1', 'H1'
                            , '2', 'H1'
                            , 'H2'
                             )
                    , DECODE (TO_CHAR (mdate, 'Q'), '1', '1', '2', '1', '2'));

         mdate := mdate + 1;
      END LOOP;

commit;

   END;
END;*/


2) Create below table in the data base.

create table xx_bi_time_day_d
(current_date  varchar2(15),
current_date_date  date,
day_num   number(15),
day_name   varchar2(25),
period_name  varchar2(15),
period_num   number(15),
week_num     number(15),
week_name      varchar2(15),
period_year varchar2(4),
quater_num    number(15),
quater_name    varchar2(3),
month_name   varchar2(25),
month_num  number(15),
half_year_name varchar2(15),
half_year_num number(15)
);

3) To Populate the data in the time table, Execute the below function.

execute update_day_dim('01-JAN-1980',50000,'Y');



Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in Oracle Database | No comments
Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • OBIEE 11g Hide/Show Sections based on Dashboard Prompt
    allow a user’s interaction to hide/show certain sections of a dashboard. In this particular case the user wanted to choose either ‘Quarterly...
  • OBIEE 11g not showing new dashboard in the drop down menu
    When creating New dashboard in  OBIEE 11g, I have faced with issue that dashboard name did not show up in drop down dashboard menu. 1. When ...
  • [OBIEE11g] - OBIEE Dashboard for Informatica Metadata Reporting
    The metadata that Informatica Power Center 8 retains in its repository can be exposed via OBIEE reports and dashboards. This metadata includ...
  • OBIEE 11g - State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46118] Out of disk space. (HY000)
    Error Details Error Codes: AAD5E5X3:OPR4ONWY:U9IM8TAC Odbc driver returned an error (SQLFetchScroll). State: HY000. Code: 10058. [NQODBC] [S...
  • [ODI] - Frequently Asked Questions (FAQ)
    Here is a list of FAQs about Oracle Data Integrator 1) What is Oracle Data Integrator (ODI)? 2) What is E-LT? 3) What components make up Ora...
  • [Informatica] Informatica Service is not Configured to run Impacted Session
    When I executed the informatica task using DAC, I got the below message despite the fact that all the sessions were refreshed and validated....
  • [OBIEE11g] - Creating Dashboard Traversing Through Graph
    The general requirement asked for by customers is that they want to Click on the Main Dashboard Page’s Graph and be transferred to the other...
  • Upper Function
    In Oracle/PLSQL, the  upper function  converts all letters in the specified string to uppercase. If there are characters in the string that ...
  • [OBIEE11g] - Dashboard Prompt - "Prompt User"
    Oracle BI 11g which we hadn't seen before, the " Prompt User " operator on a dashboard prompt. I'm not sure exactly when t...
  • [OBIEE11g] - How to rename My Dashboard
    To rename the My Dashboard follow the below steps: 1.Navigate to E:\OBIEE 11G\Oracle_BI1\bifoundation\web\msgdb\l_en\messages. 2.Locate “uim...

Categories

  • BI Publisher
  • DAC
  • DataWarehouse
  • Hyperion
  • Informatica
  • OBIEE
  • ODI
  • Oracle Applications EBS 12.1.3
  • Oracle Database
  • PL/SQL
  • SQL
  • Unix/Linux

Blog Archive

  • ▼  2013 (500)
    • ▼  November (8)
      • OBIEE11g - Custom BI Time Dimension Populate Datab...
      • OBIEE 11g - Enable Report Performance Improvement ...
      • OBIEE11g - Enable Log-Level from Advanced Tab
      • OBIEE11g - Calculating First Day of Year, Quarter,...
      • OBIEE11g - Changing Default Chart Colors
      • Error : [nQSError: 13015] You do not have the perm...
      • OBIEE 11g - Query Limit
      • OBIEE 11g - Query for Yesterday Date
    • ►  October (1)
    • ►  July (4)
    • ►  June (9)
    • ►  May (15)
    • ►  April (24)
    • ►  March (43)
    • ►  February (73)
    • ►  January (323)
Powered by Blogger.

About Me

Unknown
View my complete profile