Date Difference in OBIEE

Hi
I have two date columns and I want one logical column which contains difference of those two DATE columns.
But I found that we dont have any Date difference or Date Add functions in OBIEE Answers.
Can anyone tell me any work around for the Date ADD/DIFF functions?
Thanks
Radha

Or if you want database specific date functions, use EVALUATE and then specify the database functions. Check my blog entry here http://oraclebizint.wordpress.com/2007/09/10/oracle-bi-ee-10133-support-for-native-database-functions-and-aggregates/
Thanks,
Venkat
http://oraclebizint.wordpress.com

Similar Messages

  • Problem with Date difference in OBIEE

    Hi,
    OBIEe- 10.1.3.4
    My exp: Beginner in OBIEE
    I have a requirement to calculate a policy age with the date columns from a policy table these are.
    The columns involved are as below:
    1. policy_effective_date alias EFD
    2.policy_start_date alias STD
    3.policy_expiry_date alias EXD
    so my functionality is based as below
    Policy Age = (CASE WHEN EFD > sysdate THEN trunc( months_between( STD, sysdate ) /12 )
    ELSE trunc( months_between(EXD, STD) /12 ) END)
    I have implemented the same in OBIEE as
    Policay Age= CASE WHEN CAST (EFD AS TIMESTAMP ) >
    CURRENT_DATE THEN TIMESTAMPDIFF( SQL_TSI_YEAR , CAST (STD AS TIMESTAMP ), CURRENT_DATE ) ELSE TIMESTAMPDIFF( SQL_TSI_YEAR , CAST (STD AS TIMESTAMP ),
    CAST (EXD AS TIMESTAMP )) END
    PROBLEM!!!!: I am having the following data in the database
    EFD=06-OCT-05
    STD=06-OCT-99
    EXD=06-OCT-06
    Ideally the answer should be 7 years that is 2006-1999= 7 years but instead it gives "-93 years " thats because it does a 06-99 =-93 years.
    Please can anyone suggest where and what Date conversion can I use in the OBIEE formula??

    Try with extract year from (date column ) , it may solve your problem...

  • Date diff in obiee

    Hi,
    how can i calculate date difference in hours from 2 dates(timestamp) in obiee
    i.e. 02/03/1986:08:00 and 03/02/1986:0:14:00

    Hi,
    If you are having two date column and want the difference in hours then try with the below function:
    timestampdiff(SQL_TSI_HOUR, date_column1, Date_Colum2)
    or if you are having two date value in the expression itself then go with the below syntax:
    timestampdiff(SQL_TSI_HOUR, TIMESTAMP'1998/07/31 23:35:00', TIMESTAMP'2000/04/01 14:24:00')
    Hope it helps,
    Regards,
    Bose
    Edited by: Bose on Mar 20, 2012 3:33 PM
    Edited by: Bose on Mar 20, 2012 3:38 PM

  • Union tables from multiply data srouces in OBIEE

    Hi Pros,
    Recenetly I am doing a POC about union the same structure table from multiply data sources through OBIEE, uptill now I still can't make that out, I have tried below ways :
    Precondition: I have configured those two tables under one physical folder with two connection pool
    1. When do the union in physical level, can not implement since either can not create a view union two tables or using SQL.
    2. When do the union in Logical level, can not implement also
    I know that this kind of data integration should be done before we import into OBIEE model, but there is some policy that we can't integrate, so I just wondering whether OBIEE has this functionlity that can union data from different data source. Please advise.
    thanks

    Hi Srinivas
    After a second thought, I am wondering what you mean in the post, but the situation is that there are two tables in different data sources, Table-A and Table-B in the Physical layer, they are not yet integrated into one table(let's say Table-C), you mean add a data source indictor column into a table in BMM layer, I want to know how can we integrate data (UNION), because from my perspective, if TABLE-A have bleow column ID,NAME,ADDRESS, while the TABLE-B have the same, the difference is the data bwtween them, even we create a logicl table in BMM, drag those those columns, we only get ID,NAME,ADDRESS,ID#,NAME#,ADDRESS#, but the table structure is different.
    The problem is how to create a logic table like TABLE-D (ID,NAME,ADDRESS) which have the data both from TABLE-A and TABLE-B in Physical Layer. While no need to filter by prompt about the data sources. We need to show the data altoghter.
    Please advise if I missing you point.
    thanks
    Edited by: Henry He on Dec 28, 2010 3:21 PM

  • How to update the default date format in OBIEE 11G.

    Hi All,
    How to change the default date format in OBIEE 11g from the MM/DD to DD/MM. Could anyone please help me out ASAP?
    Thanks,
    Arpan

    Hi Arpan
    OBIEE 11g is having " localedefinitions.xml " file at this Location C:\Oracle\Middleware\Oracle_BI1\bifoundation\web\display
    in my case i installed at C:\Oracle\MIddleware.
    so
    1- Stop BI Server from EM
    2- Navigate to this Location C:\Oracle\Middleware\Oracle_BI1\bifoundation\web\display. in your case oracle home will be different
    3- take a backup of this file localedefinitions.xml "
    4- modify it and save
    5- bring BI Server up.
    Regards
    sher

  • Graph Data Labels in OBIEE 11g - Customizing

    Hi folks!
    Would somebody know how to select what is shown in graph data labels in OBIEE 11g?
    For example in a scatter graph data label I'd like to show the Group only (not the combination of Series, Group, X and Y, as by default). For a pie chart one can select the data shown in data labels to some extent (name / value), however couldn't find this option for scatter graph.
    After searching I could only find instructions for 10g - such as John's instructions at http://obiee101.blogspot.com.es/2008/01/obiee-xy-and-data-in-mouse-over-label.html.
    However, my understanding is that the graph engine in OBIEE 11g is now different, and the 10g instructions are not valid for 11g anymore.
    I was also having a look on the .cxml files in OBIEE 11g but those seem to relate to colors only?
    Any help appreciated, best regards,
    Ilmari

    hello,
    i'm facing the same situation here,did you find a solution for your problem?

  • Date Difference between to date formula variable

    Hi Expert,
                    I have create two formula variable one for Document Date and another one for Goods reciept date
    and through formula variable I am subtracting these two formula variable and getting the no. of days between
    document date and GR date.
    This Shows me the correct value for one document date because i am filtering my query according to document
    date,
    while i am giving the date range for document date is shows me incorrect result. bucause document date formula
    variable contains only one date.
    Eg. i am giving the document date range like 01.02.2010 - 28.02.2010.
          In document date formula variable it contains only 01.02..2010 and GR date formula variable it contain correct
    value, thats why the date difference is incorrect because those PO which has PO date like 12.02.2010 for that Doc
    formula variable bring the same date like 01.02.2010.
    Please tell me the solution
    Thanks and Regards
    Lalit Kumar

    Hi Expert,
                     Actually i have created two formula variable on for PO date and another for GR date
    and i've restrict the query through PO date.
    while i am taking the single PO date in Selection parameter it showing me correct difference
    eg: Selection Parameter for PO: 01.01.2010
    But while i am taking the date interval for PO date
    eg: 01.01.2010-30.01.2010
    PO No: XXXXX123 , Doc date: 01.01.2010 GR date: 7.01.2010 then date difference is : 6
    PO No: XXXXX432, Doc date: 03.01.2010 GR date: 8.01.2010 then date difference is : 7 but it is 5
    Thanks and Regards
    Lalit Kumar

  • Data difference between DBA_HIST_SQLSTAT and DBA_HIST_ACTIVE_SESS_HISTORY

    HI,
    I ran a query on a database few times which had different execution plan (basically first I ran with index and later without index).
    I tried to cross verify the data from DBA_HIST_SQLSTAT and DBA_HIST_ACTIVE_SESS_HISTORY for that particular query and found there were two different SQL ID for same SQL statement. Ideally if execution plan changes then only the plan hash value or hash value changes but in this scenario we have two different SQL ID with different Plan hash value or hash value.
    I need to understand why do we have this data difference?
    ==================================================================================================
    SQL> select snap_id,instance_number,sample_time,session_id,module,sql_plan_hash_value from dba_hist_active_sess_history where sql_id='9zgyc24gzsgpz';
    SNAP_ID INSTANCE_NUMBER SAMPLE_TIME SESSION_ID MODULE SQL_PLAN_HASH_VALUE
    9478 2 07-JAN-11 13.09.11.540 503 SQL*Plus 2290340548
    9478 2 07-JAN-11 13.23.42.616 514 SQL*Plus 3778028574
    9478 2 07-JAN-11 13.25.12.735 514 SQL*Plus 3778028574
    9478 2 07-JAN-11 13.25.22.746 514 SQL*Plus 3778028574
    9478 2 07-JAN-11 13.25.32.759 514 SQL*Plus 3778028574
    9478 2 07-JAN-11 13.25.42.770 514 SQL*Plus 3778028574
    9478 2 07-JAN-11 13.25.52.782 514 SQL*Plus 3778028574
    9478 2 07-JAN-11 13.26.02.795 514 SQL*Plus 3778028574
    9478 2 07-JAN-11 13.26.12.811 514 SQL*Plus 3778028574
    9478 2 07-JAN-11 13.26.22.823 514 SQL*Plus 3778028574
    SQL> select snap_id,sql_id,plan_hash_value from dba_hist_sqlstat where sql_id='9zgyc24gzsgpz' ;
    SNAP_ID SQL_ID PLAN_HASH_VALUE
    9478 9zgyc24gzsgpz 2290340548
    ==================================================================================================
    Thanks
    Devendra

    Hi,
    DBA_HIST_ACTIVE_SESS_HISTORY is a sampling of the sampling already done in ASH, however data used for AWR "snapshots" is completely separate and works just like Statspack did, so it can capture all SQL in the shared pool at the time of the snapshot if you tell it to - it is not limited to just the SQL sampled by ASH. Also AWR does not capture every statement executed in the interval,even if the statement was not aged out from V$SQL.
    DBA_HIST_ACTIVE_SESS_HISTORY displays the history of the contents of the in-memory active session history of recent system activity, DBA_HIST_SQLSTAT displays historical information about SQL statistics
    Regards,
    Ugur

  • Xcelsius doesn't display the date difference in Preview

    Hi,
    Im using the Xcelsius Enterprise 2008 and I use XML connectivity for the source. I would like to do some date difference calculation on my spread sheet. But the result of the date difference does no appear on the Preview for some reason. My XML file has got the date format dd/mm/yyyy hh:mm. I tried to convert the date to number format by multiplying the date by 1. When I do this the result appears correctly as I want on the Preview, but the problem is when there is a first refresh, the date difference shows a error value "#Value". I tried to enable XML Map Properties -> When refreshing or importing data:
    1. Overwrite existing data with new data
    2. Append new data to existing XML lists.
    But still not of any use. Could any one please give me a tip to resolve my problem.
    Many thanks in advance.
    Priya

    Hi Priya
    Can you please tell me what formula are you using to take difference in dates?
    Just to tell you as a point of information, Xcelsius is capable to handle very limited set of formulas. In spreadsheet you will see the formula working perfectly fine but right after hitting preview button you wont be able to see values calculated by certain formulas in Excel. So, its always good to use less and very basic formulas.
    Regards,
    Waqas

  • Oracle EBS Discoverer as a data source for OBIEE 11g

    We are a heavy user of Discoverer workbooks with Oracle EBS. We're moving to OBIEE 11g(11.1.1.3) and have an RPD with both 3rd party and custom content.
    I wanted to ask the experts here how I can leverage my Discoverer investment with out a lot of re-work in OBIEE. I briefly looked at the MigrateEUL.exe and it says it can move an EUL to an RPD, but talks about some limitations for complex EULs such as an EBS Apps EUL. Even if it created an RPD, I'm not sure how I can merge my current RPD and this newly gen'd RPD.
    I also heard from someone that there is a way to setup Discoverer EUL as a standard data source in OBIEE 11g and consume it directly. I'm looking for a document or blog that explains these steps. Any pointers or experiences with the above is appreciated!!
    Thanks.

    Hi,
    For some more details, you can refer to the following document;
    http://www.oracle.com/technetwork/developer-tools/discoverer/discoverer-metadata-conversion-assi-128504.pdf
    My personal expreriences:
    The Metadata Conversion Utility is an accellerator / assistant. It does not provide you with an end product. There is some additional handwork requiered. It could be a risk when you copy an old Oracle Discoverer environment. Shit in is shit out. Last but not least; There is not yet a workbook migration utility.
    Cheers,
    Daan Bakboord
    http://obibb.wordpress.com

  • How we calculate the date difference between two list in SharePoint 2010

    Hi friend's....I have two list first is list1. In this list i have two coulmn start_date and End_date. In second list2 i have two column HolidayName and Holiday_date. Now i want two find the number of day in list1 Excluding Weekend and Holiday_date(that
    column from list2). How i will do ..? Please help me dosto..

    Thanks for reply...
    I have done the date difference in list1. But i want to Exclude the Holiday_date form list2.
    I have list1 - Start_date , End_date, Number_of_day(Exclude weekend and Holiday_date between Start_date and End_date )
    list2 - HolidayName, Holiday_date
    Now how i will calculate the Number_of_day in first list.

  • Date difference between Requsition apporval and Po approval in Oracle apps

    My requirement is that l need to get the number of date difference between requisition apporval date(requisition) and po approval date (purchase) excluding holidays how to do it ?
    Thanks in advance..

    One PO could be generated from multiple requisitions. In that case, which requisition would you like to consider?
    One requisition could be converted into multiple POs. In that case, which PO would you like to consider?
    Assuming, there is a one-to-one relationship between your POs and requisitions:
    Link a PO to the corresponding requisition by joining po_distributions_all.req_distribution_id with po_req_distributions_all.requisition_id
    Once you have found the 2 records, get the approved_date from po_headers_all and po_requisition_headers_all
    Then go to bom_calendar_dates for those dates and find the difference between seq_num. That is what you are looking for.
    Sandeep Gandhi

  • Date Difference in same column

    select to_char(CREATEDON,'DD-MM-YYYY HH24:MM:SS'),LABSTATUS,REMARKS from history_paperlesstran
    where hnum='797551D' order by to_char(CREATEDON,'DD-MM-YYYY HH24:MM:SS');
    Rownum TO_CHAR(CREATEDON,' LABSTATUS REMARKS
    1 20-10-2010 08:10:08 1 Barcode number generated and printed
    2 20-10-2010 08:10:08 1 Barcode number generated and printed
    3 20-10-2010 08:10:08 1 Barcode number generated and printed
    4 20-10-2010 08:10:08 1 Barcode number generated and printed
    5 20-10-2010 08:10:08 1 Barcode number generated and printed
    6 20-10-2010 08:10:08 1 Barcode number generated and printed
    7 20-10-2010 09:10:55 3 Recieved in department
    8 20-10-2010 09:10:58 3 Recieved in department
    9 20-10-2010 09:10:58 3 Recieved in department
    10 20-10-2010 09:10:58 3 Recieved in department
    11 20-10-2010 09:10:58 3 Recieved in department
    12 20-10-2010 10:10:38 3 Recieved in department
    13 20-10-2010 11:10:34 1 Barcode number generated and printed
    14 20-10-2010 11:10:34 1 Barcode number generated and printed
    15 20-10-2010 11:10:35 3 Recieved in department
    16 20-10-2010 12:10:08 3 Recieved in department
    17 20-10-2010 14:10:03 1 Barcode number generated and printed
    18 20-10-2010 14:10:44 3 Recieved in department
    18 rows selected.
    Dear Friends, Now i want to get the date difference on labstatus based,i.e rownum1 - rownum7, rownum2 - rownum8, and rownum17 - rownum18
    Thing is Barcode number generated and printed - Recieved in department for each & every samples.
    Advance thanks for your solution...
    Edited by: bharathit on Oct 21, 2010 2:18 AM

    You mean something like this?
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 1 as rn, to_date('20-10-2010 08:10:08', 'DD-MM-YYYY HH24:MI:SS') as dt, 1 as labstatus, 'Barcode number generated and printed' as comments from dual union all
      2             select 2, to_date('20-10-2010 08:10:08','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
      3             select 3, to_date('20-10-2010 08:10:08','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
      4             select 4, to_date('20-10-2010 08:10:08','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
      5             select 5, to_date('20-10-2010 08:10:08','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
      6             select 6, to_date('20-10-2010 08:10:08','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
      7             select 7, to_date('20-10-2010 09:10:55','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
      8             select 8, to_date('20-10-2010 09:10:58','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
      9             select 9, to_date('20-10-2010 09:10:58','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
    10             select 10, to_date('20-10-2010 09:10:58','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
    11             select 11, to_date('20-10-2010 09:10:58','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
    12             select 12, to_date('20-10-2010 10:10:38','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
    13             select 13, to_date('20-10-2010 11:10:34','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
    14             select 14, to_date('20-10-2010 11:10:34','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
    15             select 15, to_date('20-10-2010 11:10:35','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
    16             select 16, to_date('20-10-2010 12:10:08','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual union all
    17             select 17, to_date('20-10-2010 14:10:03','DD-MM-YYYY HH24:MI:SS'), 1, 'Barcode number generated and printed' from dual union all
    18             select 18, to_date('20-10-2010 14:10:44','DD-MM-YYYY HH24:MI:SS'), 3, 'Recieved in department' from dual)
    19  --
    20  -- END OF TEST DATA
    21  --
    22     ,x as (select rn, dt, labstatus, comments, row_number() over (partition by labstatus order by rn) as labrn from t)
    23  --
    24  select y.rn as rn1, y.dt as dt1, z.rn as rn2, z.dt as dt2, round((z.dt - y.dt)*24*60) as mins_diff
    25  from x y join x z on (y.labrn = z.labrn)
    26  where y.labstatus = 1
    27* and   z.labstatus = 3
    SQL> /
           RN1 DT1                        RN2 DT2                  MINS_DIFF
             1 20/10/2010 08:10:08          7 20/10/2010 09:10:55         61
             2 20/10/2010 08:10:08          8 20/10/2010 09:10:58         61
             3 20/10/2010 08:10:08          9 20/10/2010 09:10:58         61
             4 20/10/2010 08:10:08         10 20/10/2010 09:10:58         61
             5 20/10/2010 08:10:08         11 20/10/2010 09:10:58         61
             6 20/10/2010 08:10:08         12 20/10/2010 10:10:38        121
            13 20/10/2010 11:10:34         15 20/10/2010 11:10:35          0
            14 20/10/2010 11:10:34         16 20/10/2010 12:10:08         60
            17 20/10/2010 14:10:03         18 20/10/2010 14:10:44          1
    9 rows selected.
    SQL>

  • Date difference is not showing the correct result for date interval

    Hi Expert,
                    I've created two formula variable one for PO date and another for GR date
    while i am taking the date difference of GR and PO date for single PO date selection
    it showing me correct result , but while i am taking the date interval for PO date it not
    showing the correct result.
    eg: PO date: 01.01.2010   for a particular PO and Gr date is suppose 03.01.2010, 06.01.2010
          it showing the result 2 and 5.
    But if i am taking date interval for PO date:
    eg: 01.01.2010 - 31.01.2010
    PO date: 10.01.2010 and GR date are suppose 15.01.2010, 22.01.2010 and 30.01.2010
    it showing me 14, 21 and 29
    Thanks and Regards
    Lalit Kumar

    Hi Expert,
                    Through replacement path.
    Thanks and Regards
    Lalit Kumar

  • Query report with date difference.

    Hi Expert,
    I'm using below query to monitor unreleased checks. we have a policy that the holding period for unreleased check is 5 working days.
    SELECT T2.[CardCode], T2.[CardName], T0.[TransId], T0.[DueDate], T1.[Credit], T1.[U_DisBank], T4.[Name], DateDiff(dd,T0.[DueDate],GetDate()) As 'OverDue Days' FROM OJDT T0  INNER JOIN JDT1 T1 ON T0.TransId = T1.TransId  INNER JOIN OCRD T2 ON T1.ShortName = T2.CardCode  INNER JOIN "@HOFFICE"  T4 ON T1.U_Disbank = T4.Code WHERE T1.[Credit] !=0 AND  T0.[DueDate] >=[%0] AND  T0.[DueDate] <=[%1] AND  T1.[balduedeb]+T1.[balduecred] !=0 ORDER BY T4.[Name]
    However I would like to exclude weekends in computing date difference. Can you please help me modify my query code?
    Thanks,
    Arlmi2000

    Hi,
    A simple solution will be change DateDiff(dd,T0.DueDate,GetDate()) to DateDiff(dd,T0.DueDate,GetDate())*5/7+1
    This can cover all the weekends. If you need to be exact that including public holiday, the coding will be  longer.
    Thanks,
    Gordon

Maybe you are looking for

  • Unable to start process via GP API in which group is exposed as input

    Hi,      I am not been able to start process using GP API for the particular senario. I created Process at design time. In this process I mapped parameters to a group and exposed this group, So that input is required for initiating the process. Now I

  • Bounded WildCard

    hi, What is the exact use of <?> of this wildCard Set<?> is it equal to Set<Object> Can you also explain me, why this code is not compilling. I couldn't figure it out. import java.util.ArrayList; public class Generic1{ public static void main(String[

  • How to open a bmp file

    I Want to display a bmp file and use an image icon to display it, how do I do this? tnx

  • Error: REP-1219: 'Body' has no size

    I've got a runtime error whenever I set 'mode=character' : REP-1219: 'Body' has no size -- length or width is zero What is 'Body' mean ? Header Section's body ? Main Section's body ? ... ? How can I solve this error ? Thanks.

  • What is the latest Solaris 8 Patch Cluster available?

    Currently I'm using SunOS Release 5.8 Kernel Version Generic_108528-29. Is this latest kernel version available on Solaris 8? -Sarkar