Filter value based on Date in OBIEE 11g, Reporting Issue

Hi,
I have following tables
Dim_Item
Dim_Loc
Fact_Price-Item_Key,Loc_Key,Date_Key,Reason_Code,Amount,Load_date
Reason Code is the code which discribes the reson behind price change
Amount- price of Item at particular location (Note: one item can have different price at different location)
Load Date - When ever there is price change for a particular item at particular location new record is inserted in the fact load date represents the date on which the data is updated
Item_key  Loc_key  Date_key  Reason_Code  Amount  Load_Date
1                  1        20131113                  0          1400    13/11/2013
1                  1        20131115                  6          1100    15/11/2013
2                  1        20131112                  0          900      12/11/2013
2                  2        20131112                  0          1200    12/11/2013
2                  2        20131113                  3          325      13/11/2013
My report requirement is
Report should show only the Item & location for which there is price change
Report should be like
Item Loc Orignal_Amt Changed_Amt
1       1         1400           1100
2       2         1200            325
I have tried to calculate Orignal_Amt by taking Min(Load_Date) & Changed_Amt by taking Max(Load_Date) but result is not correct
I need to min(Load_Date) or max(load_date) for an Item at particular location
i.e it should be like min(load_date by item_key,loc_key)
max(load_date by item_key,loc_key)
then I can filter out Amount based on this min & max value.
How can I achive this, is there any other approach to achive this
Thanks
Sameer

Hi,
Does this approach with comparing prices in the first and last date of the period actually indicates the price change?
What about the sample data below - is considered to be a price change or not?
Item_key  Loc_key  Date_key  Reason_Code  Amount  Load_Date
2                  2        20131110                  0          325     12/11/2013
2                  2        20131111                  0          1100    12/11/2013
2                  2        20131112                  0          1200    12/11/2013
2                  2        20131113                  3          325      13/11/2013
Option #1:
Use 2 requests:
Req1 selects surrogate key for the first and last record by load date for each location and product. Surrogate key is just a concatenated expression of Item_Key, Loc_Key and Load_Date fields (use separators between them).
For this request you need to filter out all other dates but first and last - use Rank function with BY clause. It will be 2 calculated fields: RANK(Date_Load BY Item_Key, Loc_Key) = last date, RANK(-Date_Load BY Item_Key, Loc_Key) = first date. Select records having any of these ranks=1.
In result this request should return up to 2 records for each product-location combination with surrogate key, something like this for my example:
Item_key  Loc_key  Date_key  Reason_Code  Amount  Load_Date          KEY
2                  2        20131110                  0          325     12/11/2013      LOC:2;ITM:2;DT:20131110
2                  2        20131113                  3          325      13/11/2013     LOC:2;ITM:2;DT:20131113
In fact, it could be more than 2 records in case there are more than 1 change in a day for the price and no time stored on date field. This is up to you how to eliminate duplicates.
Now you have another request, resulting one, which is filtered by Req1 using the same surrogate key expression. Orignal_Amt =Min(Amount), Change_Amt = Max(Amount). Apply a filter to find records with different values between them.
In result, if product price is the same in the beginning and end of period (or it is single record) - these records will be filtered out, otherwise you get them in the report.
Option #2:
Play around with logical SQL under Advanced tab, it allows you to write requests with joins (as regular SQL does).
This is sort of desperate option as such an analysis is hard to maintain (make modifications to it).

Similar Messages

  • Filter column based on another column - OBIEE 11g

    Hi, I have kind of a strange requirement. I'm trying to build a dashboard that lets a user see data for the current day, last week, last month, or last year. I'm going to create a presentation variable called "date_range" where the user can choose one of those 4 options.
    Based on this, I've defined a column in answers with the following formula:
    cast
    case
    when 1 = 0 then "Query Time"."Date"
    when @{date_range}{'Day'} = 'Day' then Current_Date
    when @{date_range}{'Week'} = 'Week' then TIMESTAMPADD(SQL_TSI_DAY, -7, CURRENT_DATE)
    when @{date_range}{'Day'} = 'Month' then TIMESTAMPADD(SQL_TSI_DAY, -30, CURRENT_DATE)
    when @{date_range}{'Day'} = 'Year' then TIMESTAMPADD(SQL_TSI_DAY, -365, CURRENT_DATE)
    else TIMESTAMPADD(SQL_TSI_DAY, -10000, CURRENT_DATE)
    end as DATE
    Based on the 4 presentation variable, this should give the proper "start date" of when to pull data.
    Now I've added the actual date column from the date dimension. But I need to put a filter on the date dimension date column that says it's greater than or equal to the calculated column above. How do I do that?
    Thanks,
    Scott

    I always expect what you're expecting, but you can't filter a column on another column. The solution is just to write one formula that returns a literal, so it will be
    case when (your date column) >= (your long formula) then 'Y' else 'N' end
    Then filter that column on 'Y'.
    Regards,
    Robert

  • How to get the Maximum of two calender dates in OBIEE 11g Analytics

    Hi,
    I have requirement like getting the  maximum calendar date from two calendar dates in obiee 11g reports and  the requirement is like the following
    max(Reported.Calendar date, Returned.Calendar Date)
    can anyone help me to solve this issue.
    Thanks,

    Something like this...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('17-nov-2006','dd-mon-yyyy') as c_start_date, to_date('21-jan-2008','dd-mon-yyyy') as c_end_date from dual union all
      2             select to_date('21-nov-2006','dd-mon-yyyy'), to_date('17-feb-2008','dd-mon-yyyy') from dual union all
      3             select to_date('21-jun-2006','dd-mon-yyyy'), to_date('17-jul-2008','dd-mon-yyyy') from dual
      4             )
      5  -- end of test data
      6  select c_start_date, c_end_date
      7        ,trunc(months_between(c_end_date, c_start_date) / 12) as yrs
      8        ,trunc(mod(months_between(c_end_date, c_start_date), 12)) as mnths
      9        ,trunc(c_end_date - add_months(c_start_date, trunc(months_between(c_end_date, c_start_date)))) as dys
    10* from t
    SQL> /
    C_START_D C_END_DAT        YRS      MNTHS        DYS
    17-NOV-06 21-JAN-08          1          2          4
    21-NOV-06 17-FEB-08          1          2         27
    21-JUN-06 17-JUL-08          2          0         26
    SQL>But, don't forget that different months have different numbers of days, and leap years can effect it too.

  • ToolTip in OBIEE 11G Reports when we hover on its data!!

    Hello gurus,
    I have a requirement where I have to display ToolTip in OBIEE 11G reports when one hovers on its data. For example, If I have a column in a report which displays "serial no." say the data in column is 1,2,3,4,5 etc. when I hover on 1, it should display name corresponding to it. when I hover on 2, it should display another name.
    These values which will be displayed on hover action can be hardcoded, they are static values.
    Thanks in advance !!

    Hi User,
    Try this , Goto Column Properties of a particular Column ->Data Format->Check mark "Override Default Data Format" and select
    Treat Numbers As : Custom
    In Custom Numeric Format, Copy paste this code: [html]<p title=\""Comments which you want to Mention" \">#
    Please Mark helpful if it is correct.
    Regards,
    OBIEELearner.
    Edited by: obieelearner on Nov 2, 2012 10:09 AM

  • OBIEE 11g Report UI not showing data

    Hi,
    On Obiee 11g Report, the query hit by the report at the backend shows results for all the columns but on UI only few of these columns show the data. From Query log, when I run the same query in the database I see all columns have data which is somehow not showing up on the UI end. What could be the problem? Can this be resolved or is it a bug in the OBIEE 11g?
    Regards
    VM

    Hi Vanaja M/Gurus,
    Is that your problem resolved?
    I'm facing same issue here.
    I was checking for solution/suggestions in blogs, but unfortunately i couldn't find much information in blogs too....
    Can you help me out to cross this hurdle, as this issue is in Production.

  • Stop a dimensional drill for a particular value of a column in obiee 11g

    Hi,
    I have dimensional drill been setup for Supervisor Hierarchy Table.I need to stop the dimensional drill for a particular value of the column in obiee 11g.
    Example: I have two columns
    1.Supervisor Level 1 Name
    2.Supervisor Level 2 Name
    Supervisor Level 1 Name Columns have these values.(Ram,Higher,Sam)
    Supervisor Level 2 Name Columns have these values.(Ravi,Higher,Raghul).
    If we pull Supervisor Level 1 Name Column in report which has a dimensional drill(It will navigate to Supervisor Level 2 Name).It will show
    1.Ram
    2.Higher
    3.Sam
    I should not drill on Higher value but the rest of the values(Sam and Ram will drill to Supervisor Level 2 Name) should be drillable.The same should happen for Supervisor Level 2 Name.
    Please Suggest.
    Thanks,
    Azim

    Azim,
    Don't think you can actually get this working

  • Obiee 11g upgrade issue for date format

    Hi,
    I am facing a date format issue with obiee 11g report. This statement cast(cast(current_date as char) as timestamp) is failing with "not a valid month" error in obiee 11g. This worked fine with obiee 10g.
    I am basically trying to set the date to 12:00:00 am of the sysdate. Below is what I am trying to achieve:
    timestampadd(sql_tsi_hour, 1, cast(cast(current_date as char) as timestamp)))
    the above statement fails in obiee 11g.
    Thanks for your help,
    AP

    I dont think you need any functions to get the required output, try to set the date format as below
    [FMT:timeStampShort]
    If helps mark
    Thanks
    Edited by: Srini VEERAVALLI on Apr 23, 2013 4:18 PM
    I think with format and then the below should work with no issues.
    timestampadd(sql_tsi_hour, 1,current_date)
    I think you are wasting time by posting here, just do it. You no need any ones permissions to do it ;)
    Edited by: Srini VEERAVALLI on Apr 24, 2013 8:55 AM

  • Different calculation on each column in table in obiee 11g report??

    Hi ,
    I have to display values in a table for measures in obiee 11g report which should hold different calculation on each column. For ex:
    Result 1:
    Flag  Display   Transaction  Amount
      C      'A'                 2              3
      C      'B'                 3               0
           SubTotal1            5             3
    Result 2:
    Flag  Display   Transaction  Amount
      H      'C'                 2              11
      H      'D'                  0              0
           SubTotal2          2             11
    Result 3:
    Flag  Display   Transaction  Amount
      H      'C'                 1              0
      H      'D'                  1            0
           SubTotal3          2            0
    Final Result:(Transaction shd hold :-subtotal1-subtal2 , Amount should hold:-subtotal1-subtal2+subtota3)
    Flag   Display               Transaction         Amount
    C    'total tran(1-2)              3                     8
           Total Amnt(1-2+3)'     
    Please help me how can i achieve this ... ??? I am new to OBIEE 11g.
    Thanks,
    Pavi

    There are a few things I cannot understand; I'm assuming Transaction and Amount are fact columns. Then how do they have different values for the same values of Flag and Display ??
    Anyway, sub total can be achieved by going to edit view for the table and from columns and measures area under the Layout pane click on the summation icon and select After.  This will automatically display a grand total value at the bottom of each fact column.
    Now, to get the final result, say Total Transaction you can add a dummy column and edit its formula.
         Total Transaction = trans_subtotal1 - trans_subtotal2 and
         Total Amount = amt_subtotal1 - amt_subtotal2 + amt_subtotal3
         Now if we could say that trans_subtotal1 is the total of transaction value when Flag = 'C' or something like that then you can get this value of subtotal1 by using the formula FILTER(SUM("Subject Area"."Folder".Transaction Column") USING (DESCRIPTOR_IDOF("Subject Area"."Folder"."Flag column") = 'C')).  Similarly we can obtain subtotal2 and subtract them to get the total transaction value.  But I am sure if we can do this because for the same values of Flag and Display, Transaction has different values.  But by using the above formula, the values we obtain for subtotals 2 and 3 will be the same.  So calculating Total Amount would be a problem.
    The above formula is obtained by going to edit formula and selecting the filter option at the bottom of the edit dialog box.
    Hope I made my point clear

  • Display BLOB/CLOB image data in OBIEE 11g

    Dear Gurus,
    I want to display employee profile picture in dashboard, the image data was saved as blob/clob image.
    How to configure and display it in obiee?
    Regards
    JOE

    Hi
    Thanks for your quick response.
    actually im not using EBS, im just using publisher with OBIEE 11g.
    if explain step by step what you wrote first replay-
    Let i have a table with one BLOB column.
    1) first load blob data to my table
    2) create data model from oracle publisher.
    3) change the xdm file with above tagline , my xdm file is in below link-
    C:\mw_bi_home\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips1\catalog\SampleAppLite\root\shared\zia%2exdm
    i don't know is that right step? because if i re-open the xdm file after change by your given tagline its shows error.
    I will grateful to you please give me a little explanation which file i can put the following tagline.
    _<fo:instream-foreign-object content-type="image/jpg"><xsl:value-of select=".//IMAGE_ELEMENT"/></fo:instream-foreign-object>_
    Thanks again and waiting your feedback -
    @zia

  • Passing filter values from column formula in OBIEE 10g

    Hi,
    I am trying to pass filter value from the column LY Spend YTD columns where we have a filter option and passing the year filter 2013 as below.
    FILTER("Fact - Purchasing - Invoice"."LY Spend YTD" USING (Time."Year" = '2013'))
    My goal behind doing this is, we have a filter already present for the whole criteria on the year which is 2012.
    But specifically for this column i dont want to pass the year 2012 to it, Instead I want to pass 2013 to it. But I am not succeding the result is blank.
    Please suggest and let me know if further understanding is needed.

    Hi Srini
    Thanks for you reply.
    I cannot do that way because some measures are satisfying with year 2012 and displaying the data and other measure are satisfying with 2013.
    I am working on LY Spend YTD, LY spend YTD - 1, Spend YTD and Year ago spend.
    So thats the reason I have thought that way of passing the filter in column formula irrespective of criteria filter.
    Please suggest.

  • How to get previous values based on date filters

    Hi
    i have two fields gldate and startdate
    gldate values are like 1/31/2011,2/28/2011,3/31/2011,4/30/2011,5/31/2011 ...
    startdate values 1/1/2011,2/1/2011,3/1/2011,4/1/2011,5/1/2011 ...
    i need a condition like gldate<startdate
    if startdate is 11/1/2011 then i get all the values before 11/1/2011 values
    im using filter for date filed
    let us filter values is startdate--11/1/2011 and gldate is 11/30/2011 but that cond falls
    how to get this condition
    plz its urgent to me

    Hi
    i have two fields gldate and startdate
    gldate values are like 1/31/2011,2/28/2011,3/31/2011,4/30/2011,5/31/2011 ...
    startdate values 1/1/2011,2/1/2011,3/1/2011,4/1/2011,5/1/2011 ...
    i need a condition like gldate<startdate
    if startdate is 11/1/2011 then i get all the values before 11/1/2011 values
    im using filter for date filed
    let us filter values is startdate--11/1/2011 and gldate is 11/30/2011 but that cond falls
    how to get this condition
    plz its urgent to me

  • How to hide % measure column Grand Total  value in Pivot View in obiee 11g?

    Hi ,
    I am facing a issue in obiee 11g .I am using a Pivot table to display the grand total of 3 metric columns eg: A , B,  C out of which B is percentage  so I need to remove the grand total value of the percentage column. We have to stick to Pivot View only. Anyone can sugest me on this?
    Thanks ,
    Shruti

    Move B to rows section or cast to char in Criteria tab by keeping the B in Measures section only.
    cast(B as char)

  • How to get completed  last 3,6,12 months  data in obiee 11g

    Hi,
    My scenario is am having Report A and Report B.
    Report A is a Parent Report and which is having Date Column & Fact Columns.Report B is a Child report of Repot A which is supposed to show the completed last 3 ,6,12 months fact data in chart view.
    eg,
    Suppose value of Date in Report A is 23-Jul-2012 So in Report B i have to show june,april,may months data in chart view(like 6,12 months..).Because july month is not completed.
    How i can achieve this? Kindly help me.
    Thanks,
    Yams

    Approach would be take an itemediate report between A and B. Pass the date value to intermediate report which holds the date from Report A and
    calucate what was the date for 3, 6 , 12 months. Now you get the date and year.
    In the Repor B use FILTER from intermediate filter.
    You can use TIMESTAMPADD or TIMESTAMPDIFF if possible.

  • How to load one filter values based on another filter selection

    Hi,
    I have a Query/Report that contains the following filters
    Product Family
    Product Line
    Product
    all the above InfoObjects are independent, now i need a functionality where in if i select a Product Family then all the Product Line belonging to that Product Family should get loaded in the filter selection, same way when a Product Line is selected the all the Products under that Product Line should get loaded ni Products filter.
    Please let me know how this functionality can be achived.
    Thanks
    Akila. R

    Hi Akila,
    I am assuming you query runs on a cube that loads data from the source system. In that case cube will contain only valid cobminations of Product Family & Product Line.
    In order to make sure that if a cetain Product Family is chosen you want to see only the relevant Product Line as available in the cube do the following:
    Go to Query Designer Filter
    Pick Product Family > Properties> Advanced. Under the Tab Filter Value Selection during Query Execution choose 'Only Values in InfoProvider'
    Do the same setting for Product Line as well.
    Hope this helps.
    Regards,
    Amrita
    Edited by: Amrita Goswami on Jun 23, 2009 7:26 AM

  • Coloring value with condition in Analysis OBIEE 11g

    Dear Gurus,
    I have pivot analysis, which show date and sales.
    I want to highlight the value of the date if it holiday.
    I want to coloring red the holiday date.
    How to do that?
    Thank you before
    Regards
    JOE

    Hi,
    Here I have one question,
    How you know wether which day is holiday in your time dim? do you have any condition on that?
    If you know that just go-->time date column properties-->click --> condtinoal tab--> apply filter condition and apply the color as you like.
    Hope this help's
    Thanks
    satya

Maybe you are looking for

  • Will I be able to transfer movies from a windows pc to my iPad?

    And how would I do that? And what does iTunes have to do with it? Do i have to install another app from the store to make that video work on my iPad? Sorry I'm really new to this Been an android user and was just used to dragging and dropping files.

  • Java update massive problems

    10.4.11 Just updated Java...browsers were quit...permission fixed etc..rebooted...cannot access American express website or Apple log in using Firefox. Safari works for some, but not AMEX. Web and Mail also now hang intermittently. How do I get back

  • Hyperlinks are not working when I convert MS PPT with notes to PDF

    I am using MS Powerpoint 2010 and have some hyperlinks throughout the presentation. When I Save as "PDF" and select the options "Notes pages" and open up the PDF, I see the slide and then the notes on the bottom of the page but the hyperlinks within

  • Is it possible to alter button image transparency in a "Standard" menu?

    Hello all, A newbie to DVDSP 4.0 here. I've been given a project where I have to match a pre-existing menu and navigation design (the original files are not available for me to use). I have been able to recreate the design of the menus without any pr

  • Time capsule not seeing old backups, now its backing up my computer again

    Hi: I moved my TC today to a new apartment. Same computer and everything. I can mount the drive and see the macbook pro backup file but i cant connect to it with time machine. Now when I back up my computer again, it is starting a new backup of the e