Tuesday, 30 December 2014

Current Date and Yesterday Date in Dashboard Prompt

  1. Create a prompt on date column as per your requirement
  2. Expand Options and in Choice List Values option drop-down, select SQL Results and paste below Query ( Based on your Subject Area)
           SELECT CURRENT_DATE  FROM "Project - PRM and Time Management"
           UNION
           SELECT  TIMESTAMPADD(SQL_TSI_DAY,-1,CURRENT_DATE)  FROM

           "Project - PRM and Time Management"     




















    Thanks,
    Naveen

    Friday, 14 November 2014

    Current Year and Previous Year in Prompt

    SELECT YEAR(CURRENT_DATE) FROM "Human Resources - Workforce Profile" 
    UNION
    SELECT YEAR(CURRENT_DATE)-1 FROM "Human Resources - Workforce Profile"























    Thanks,

    Display last year data while selecting year in dashboard Prompt

    Requirement is to display Current Year and Last Year data when select year from dashboard Prompt..

    Steps:
    Create a dashboard Prompt and set a presentation variable
























    Now create a Dashboard Report and call above presentation variable




































    Create a dashboard with above report and prompt

    Display Data of Last 4 Quarters

    Requirement is to display data of last 4 Quarters,8 Quarters when user select Quarter from Dashboard Prompt,  Quarter format is 2014 Q 4 , 2013 Q 3 etc.

    Steps:
    First we will create a report(Control Report) which will give previous quarters data ,This Control report Columns will be called in Dashboard Report

    Control Report:

















    Column Formula of "Year Quarter"
    User will select from Prompt

    Column Formula of  "4 Quarter Ago" 
    CASE WHEN SUBSTRING("Time"."Year Quarter",8,1 ) ='1' THEN CAST((CAST("Time"."Year" AS INTEGER)-1) AS VARCHAR(4))||' Q 1'  WHEN SUBSTRING("Time"."Year Quarter",8,1 ) ='2' THEN CAST((CAST("Time"."Year" AS INTEGER)-1) AS VARCHAR(4))||' Q 2' WHEN SUBSTRING("Time"."Year Quarter",8,1 ) ='3' THEN CAST((CAST("Time"."Year" AS INTEGER)-1) AS VARCHAR(4))||' Q 3'  ELSE CAST((CAST("Time"."Year" AS INTEGER)-1) AS VARCHAR(4))||' Q 4' END

    Column formula of "8 Quarter Ago"
    CASE WHEN SUBSTRING("Time"."Year Quarter",8,1 ) ='1' THEN CAST((CAST("Time"."Year" AS INTEGER)-2) AS VARCHAR(4))||' Q 1'  WHEN SUBSTRING("Time"."Year Quarter",8,1 ) ='2' THEN CAST((CAST("Time"."Year" AS INTEGER)-2) AS VARCHAR(4))||' Q 2' WHEN SUBSTRING("Time"."Year Quarter",8,1 ) ='3' THEN CAST((CAST("Time"."Year" AS INTEGER)-2) AS VARCHAR(4))||' Q 3'  ELSE CAST((CAST("Time"."Year" AS INTEGER)-2) AS VARCHAR(4))||' Q 4' END

    We now will call this report(Control Report)  in our Dashboard Report:
    Filter in the Dashboard report is based on Control Report:

    Dashboard Report:

















    Dashboard Prompt is below :

















    Below is the Dashboard when report and Prompt are taken place:





    Sunday, 12 October 2014

    Sorting of Grand Total Value in Pivot View

    In a pivot view, you don't have any options to choose the sort order on any measure columns (column grand total include).
    I figured it out a way,thought it might help you as well so posting this.

    Example:  Arrange Total Transaction Amount USD Total in Descending Order
















    Unfortunately, a pivot view is always sort by dimension so For that we need add another metric name it as sort with the measure 'Total Transaction Amount USD Total" in the below format

    Add a new column in the report






    and in the edit formula
    CAST(RANK(SUM("Fact Table"."Total Transaction Amount USD" BY"Dimension Table"."Incurred by Person Name")) AS INTEGER)

    and treat that column as an attribute column by clicking on the check box shown below:












    Then in the report it will appear as below:  the Sort column is available in the report we can hide that by using Column Properties.

























    Finally the report sorted by Descending order on Grand Total as below:

    Thanks

    Saturday, 5 July 2014

    Difference B/W OBIEE 10g and 11g

    • OBIEE 11g uses WebLogic Server as the application server as compared to Oracle AS or OC4J in OBIEE 10g. 
    • The session variables get initialized when they are actually used in OBIEE 11g unlike OBIEE 10g where they were initialized as soon as a user logs in.
    • In 11g Users and groups are created in Enterprise Manager (EM) whereas in 10g Users and groups are created in repository.
    • New time series functions PERIOD ROLLING and AGGREGATE AT are introduced.
    • Timeseries function can be created in Answers as well.
    • Logical Table Source(LTS) Priority ordering is introduced.
    •  OBIEE Join is done from fact to dimension whereas in 10g join is done from dimension to fact.
    • A new column called the hierarchical column in introduced.
    • OBIEE 11g now supports Ragged (Unbalanced) and Skipped Hierarchy.
    • Parent Child hierarchy is introduced.
    • We can now model lookup tables in the repository.
    • SELECT_PHYSICAL command is supported in OBIEE 11g.
    • In OBIEE 11g we can create KPIs to represent business metrics.

        In OBIEE 11g there are some changes in terminology as well:

    • iBots are renamed as Agents.
    • Requests are renamed as Analysis.
    • Charts are renamed as Graphs.
    • Presentation Columns are renamed as Attribute Columns.
    • The new UI called Unified Framework now combines Answers, Dashboards, and Delivers.

           

    Time Series Functions in OBIEE

    1) Ago

    Ago is a time series function that calculates the aggregated value from the current time back to a specified time period. this is useful for comparison  such as amount compared to amount a month ago.

    Syntax:  AGO(<Measure >,<Level>,<number of period>)

    Measure: A measure column.
    Level: On which level you want to calculate this measure such as Year,Quarter,Month etc.
    Number of period: how many level you want to go back from current time such as 2 year back,2 months back etc.

    Example : AGO(Amount,Year,1) this will give the last year amount .

    2) ToDate 

    To Date is a time series function that calculates a measure attributes from the beginning of a specified time period to the currently displayed time period.

    Syntax : ToDate(<Measure>,<Level>)

    Measure: A measure column.
    Level: On which level you want to calculate this measure such as Year,Quarter,Month etc.

    Example : ToDate(Amount,Year) this will give the amount from the beginning of the year to Currently displayed time.

    3) Period Rolling

    Period Rolling is a new time series function in 11g .It computes the sum of a measure over the period starting x units of time and ending y units of time from the current time .This function allow us to create a aggregated measures across a specified set of query grain period rather than within a fixed time series grain.

    Syntax: PeriodRolling(<Measure>,<Starting Period Offset>, < Starting Period Offset>)

    Measure: A measure column.
    Starting Period Offset: Starting period used in rolling aggregation.
    Ending Period Offset: Ending period used in rolling aggregation.

    Example : PeriodRolling(Amount,-2,0) this will give three months rolling sum of column Amount.It includes past two months with the current month. Numerical value -2 indicates May-14,Jun-14 if current month is Jul-14.Numerical value 0 indicates current month.

    Note : This function has no time series grain ,the length of the rolling sequence is determined by query grain for example it will give the last three Month amount if the query grain is month , if the query grain is year then it will give last three Year Amount.



    Repository and Session Variables

    Session Variables: Session variables are created and assigned a value when each user logs on(when a new session is started). When a user begins a session, the Oracle BI Server creates new instances of session variables and initializes them.

    There are two types of session variables:

    1. System Variables: Oracle BI Server and Oracle BI Presentation Services use for specific purposes. 
    System variables have reserved names, which cannot be used for other kinds of variables (such as static or dynamic repository variables, or for non-system session variables). 
    Ex: To filter a column on the value of the variable LOGLEVEL set the filter to the Variable NQ_SESSION.LOGLEVEL.

    2. Non System Variables: A common use for nonsystem session variables is setting user filters. For example, you could define a nonsystem variable called SalesRegion that would be initialized to the name of the sales region of the user.


    Repository Variables :  A repository variable has a single value at any point in time.

    There are two types of repository variables:

    1. Static Variable: The value of a static repository variable is initialized in the Variable dialog. This value persists, and does not change until an administrator decides to change it.


    2. Dynamic Variable : The values of these variables change with the values returned by queries. When the repository is started the value returned by the query in the initialization block will be assigned to the dynamic variable.

    Implicit Fact column in OBIEE

    An  Implicit fact column is used when we have multiple fact tables and the report is generated only from dimension tables. 
    A user may create a report where it have only dimensions and not a single fact measure. when these are created BI server has multiple join paths available between dimensions and facts so it joins to nearest fact table and pulls the data hence results obtained might be different from what user is expecting.To overcome this we can create a Implicit fact column.This Implicit fact column shows the join path for the BI server.

    Slowly Changing Dimensions (SCD)

    Slowly Changing Dimensions (SCD) : With Slowly Changing Dimensions (SCDs) , data changes slowly, rather than changing on a time-based, regular schedule. In Data Warehouse there is a need to track changes in dimension attributes in order to report historical data.
    Example of SCD dimensions are : Employee marital Status , City
    Varios Types of SCD:
    ·         Type 0 - The passive method
    ·         Type 1 - Overwriting the old value
    ·         Type 2 - Creating a new additional record
    ·         Type 3 - Adding a new column
    ·         Type 4 - Using historical table
    ·         Type 6 - Combine approaches of types 1,2,3 (1+2+3=6)

    SCD Type 1: Overwriting the old value. In this method no history of dimension changes is kept in the database. The old dimension value is simply overwritten be the new one. 
    Example, we have this table:
    Emp ID
    Empname
    City
    123
    Naveen
    Delhi

    After Naveen moved from Delhi to bangalore, the new information replaces the new record.
    Emp ID
    Empname
    City
    123
    Naveen
    Bangalore

    The disadvantage of the Type I method is that there is no history in the data warehouse. It has the advantage however that it's easy to maintain
    Note: This type should be only used when it is not  necessary  to track  historical changes.

    SCD Type 2: This method tracks historical data by creating multiple records means a new record is added to give us the new information hence both records will be present

    In our example,we have this table 
    Emp ID
    Empname
    City
    Start_Date
    End_Date
    Active_Flg
    123
    Naveen
    Delhi
    14-10-2010
    31-12-9999
    Y

    after naveen moved from Delhi to bangalore ,a new record will be added in the table:
    Emp ID
    Empname
    City
    Start_Date
    End_Date
    Active_Flg
    123
    Naveen
    Delhi
    14-10-2010
    22-5-2014
    N
    124
    Naveen
    Bangalore
    23-5-2014
    31-12-9999
    Y

    The advantage of the Type 3 method is that it helps us to keep all historical information  .it has the disadvantage however that this will cause the size of the table to grow fast

    Note: This type should be only used when it is necessary  to track  historical changes.

    SCD Type 3:  This method tracks changes using separate columns and preserves limited history.
    In this type usually only the current and previous value of dimension is kept in the datawarehouse. there will be two columns one represents previous information  and another represents current information .there will also be a column that indicates when the current value becomes active.

    Emp ID
    Empname
    Original City
    Current_City
    Effective_start_date
    123
    Naveen
    Delhi
    Bangalore
    23-5-2014

    The advantage of the Type 3 method is that it helps us to keep previous change only also it does not increase the size of table.it has the disadvantage however that it won't be able to keep all history where an attribute is changed more than twice.

    A fatal error occurred while processing the request. The server responded with: FOProcessor cannot run without a valid TMP directory. Please check if TMP directory exist and write enabled.

    When attempting to export a Dashboard to Excel the following error message in sawlog is found: A fatal error occurred while processi...