Subtracting two fact values of today and Previous day Measures.

Hi,
I am having an Requirement in which i need to show the values comong form two fact Tables.
Consider fact1 will be always having today's date ie(one day record) which is having few Measure Columns.
Fact2 will be always having previous day date(ie Previous day Record) which is also having some measure Columns.
Now my Requirement is i need to display fact1.Measure1-Fact2 Measure1 along with today's date.The problem we are facing is that because of the day level granularity we are not geeting previous day record ie(Fact2.Measure1) in the output.I tried union Request because of same granularity problem we are getting null value.
Kindly help me how to resolve this issue.
Regards,
yams

Can you check this link once you may get some idea if not can you share example with data?
Re: Second row data -  First row data of other column?

Similar Messages

  • Subtract   two dates to get   months and days

    I havew to subtract two dates and get the differnce ,
              Date issuedDate= myobj.getIssueDate();
              Date expirationDate=DateUtils.addMonths(issuedDate, 6);
              long timeDiff=expirationDate.getTime()-new Date().getTime();
              long daysRemaning=timeDiff/86400000;this is code I get the number of days between the issue date and todays date.now my client wants not just days but months and days , i need suggestions on how to get days and months between any two given dates

    I have read that it is best to use java.util.Calendar for almost any time related issue.
    With some switch statements and a for loop, I think the Calendar class could solve the problem.

  • Two FACT Tables, Some Common and Non-Common Dimensions

    Hello all, a question i am sure you have faced in the past but still wanted to get your feedback.
    I have a few FACT tables and some dimensions that are shared (common dimensions). Rest of the dimensions are related to one or the other FACT tables.
    What is the best way to present a view where users can pull information from both the FACT tables?
    I am successful in pulling the shared (common) dimensions across BOTH FACT tables having the same grain but this view breaks down when i pull information from one Dimension that has not much to do with the other FACT.
    What is the best way to present this? Should this be broken in three subject areas?
    Subject Area 1 --> Some Dims --> FACT Table A
    Subject Area 2 --> Some Dims --> FACT Table B
    AND
    Subject Area 3 --> ***Only Common Dims*** --> FACT Table A & FACT Table B?
    Your feedback is always appreciated.
    Regards,
    Edited by: user10679130 on Oct 12, 2009 3:27 PM

    Please check the forum first for similar threads/questions.
    Joining two fact tables with different dimensions into single logical table
    http://108obiee.blogspot.com/2009/08/joining-two-fact-tables-with-different.html
    This solution keeps both fact tables in the same subject area in the single logical fact table, with common and not-common dimensions.
    Regards
    Goran
    http://108obiee.blogspot.com

  • Calculate the days between today and specific day.

    I'm trying to calculate the number days between Today and some specific date in the future using SharPoint Designer (XSL). This is what I'm using:
    <xsl:value-of select="number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(@Due_Date))))- number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($Today))))" />
    e.g. 23 days >>>> 634948416000000000 ticks
    This works perfectly while I'm in SPDesigner itself, but once I try to see it in the browser it shows the number of days in "Tick Numbers". Is there a way I can fix this? I've been looking all over the internet and I haven't found any really good answer.
    thanks!

    Thanks for the quick response Marc.
    I've no experience of using momentsJs with SharePoint lists and I need to be able to get this up and running pretty quickly. I guess you need some coding experience to use it?
    I'm thinking that there should be a way to do this in SPD with something similar to this from another site, but with the conditions placed on the source field (Planned end Date)  instead of the current date. 
    not((ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@Plan_x0020_Ende)))
    >=
    (ddwrt:DateTimeTick(ddwrt:Today())-(7*24*60*60*1000*10000)))
        and
    (ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@Plan_x0020_Ende)))
    <=
    (ddwrt:DateTimeTick(ddwrt:Today())+(7*24*60*60*1000*10000))))
    and
    not((ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@Ist_x0020_Ende)))
    >=
    (ddwrt:DateTimeTick(ddwrt:Today())-(7*24*60*60*1000*10000)))
        and
    (ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($thisNode/@Ist_x0020_Ende)))
    <=
    (ddwrt:DateTimeTick(ddwrt:Today())+(7*24*60*60*1000*10000))))

  • ST03N, i am not able to see today n previous day data

    Hii All
    In my ST03N, i am not able to see today n last day data, it shows me data upto last two day before data. plz tell me abt where i can check the retention period.
    System Details:
    SAP: ECC 6.0
    DATA BASE: ORACLE 10G
    OS: AIX5.3
    SAP KERNEL:179
    SAP_ABA: SAPKA70015
    SAP_BASIS:SAPKB70015
    ST-PI:2008_1_700
    PI_BASIS:SAPKIPYJ7F
    Already jobs:
    SAP_COLLECTOR_FOR_PERFMONITOR
    SAP_APPLICATION_STAT_COLLECTOR
    SAP_CCMS_MAPPING_SCHEDULER
    SAP_COLLECTOR_FOR_JOBSTATISTIC
    and saposcol running fine.
    Thanks
    Amit Srivastava
    Basis

    Hi
    You can refere this [Link|No system load data available; may help you
    Regards
    Uday

  • I spent  two hours downloading Elements today and now I can't find the program on my computer.

    Where is it???

    I believe so but that would be a question better asked in the Photoshop Elements forum.  You can post your inquiry to the Elements forum at http://forums.adobe.com/community/photoshop_elements.
    If you are still facing difficulty with the download of the trial software then please try the directions listed at http://prodesigntools.com/photoshop-elements-11-direct-download-links-pse-premiere-pre.htm l.  Please make sure to complete the Very Important Instructions section prior to scrolling down and clicking on the download links.

  • Show current month and previous month measures

    Experts,
    My period names are stored like this in the Period Dim table 'Jan 2012'.....'Aug 2012', ... 'Dec 2012' etc..
    To my request, i will pass only the current period value via. a drop down prompt, say 'Feb 2013' and it has to apply filter like this Period."Period name" in ('Feb 2013', 'Jan 2013').
    I cannot use TIMESTAMPADD(SQL_TSI_MONTH, -1, Period."period name") as my period name is a char. Can someone suggest any idea?
    Version : 10.1.3.4
    Regards,
    Sarvan

    Hi,
    This can be achived,but little bit tedious process...
    Create an intermediate report with three columns.
    first column : Monthcolumn,which you are using in prompt.
    Second column :This column is for selected month
    Try to convert Jan 2012 to 201201,Feb 2012 to 201202...This can be achieved by writing a case statement like below
    cast((Case when substring(column from 1 for 3)='Jan' then 01...........)||substring(column from 5 for 4) as int)
    Third column:Prior month
    cast((Case when substring(column from 1 for 3)='Jan' then 01...........)||substring(column from 5 for 4) as int)-1
    Now add the same column formula to the main report and hide it(let's say column name will be "HIDED")
    cast((Case when substring(column from 1 for 3)='Jan' then 01...........)||substring(column from 5 for 4) as int)
    Now you can apply filter based on another request on the hided column.
    HIDED<=Second column in intermediate report.
    HIDED>=Third column in intermediate report.
    Now you will get the desired reults in your report.
    Hope this helps.
    Thanks,
    Pramod.

  • Parameter for current year and previous year

    Hi all,
    I currently have 2 reports where the query is the same except in the where clause I have it filtered to current year and previous year based on the List_Date. I would like to make this one report with a parameter of Current or Previous year.
    Would I create 2 more datasets one for current and another for previous? I would think there is a easier way. Any help or direction would be great.  

    If you define a parameter in SSRS, you can use it's value in your query. Just make sure the parameter name, and CASE (SSRS is case sensitive when it comes to parameters) are the same in SSRS and your query. There's a parameter tab on the dataset properties.
    It SHOULD auto fill, but it never hurts to check, just in case.
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.
    Yes it did auto fill the parameter tab in the dataset and I get a parameter to enter the year when I preview the report. Still a little confused on how I do current or previous year. Are the next steps what I need to do?
    @yearParam parameter:
    1) Create  Available or Default values 
    2) Current and Previous year as label
    3) For Value do I need to use a expression for current year =Year(now()) and previous Year?
    4) Add a filter on the tablix for list_date?

  • Unable to join two fact tables via one common dimension in RPD(Repository)

    I have created two fact tables F1 & F2 and one dimension D.
    F1 is joined to D and F2 is also joined to D in Physical layer as well as in BMM layer.
    I created one report in OBI Answers using these three tables.It Showed me the following error.
    **Error Details**
    **Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P**
    **State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table dfghdfh) does not contain mapping for [Dashboard_Fact.Period_Sgt_Key]. (HY000)**
    **SQL Issued: SELECT dfghdfh.Period_Sgt_Key saw_0, "Period Dim".Period_Sgt_Key saw_1, Dashboard_Fact.Period_Sgt_Key saw_2 FROM service_delivery ORDER BY saw_0, saw_1, saw_2**
    How to cope up with the issue or can anyone tell me the alternate workaround for this?

    That is what i have tried.
    I have made a logical table TEST and dragged two fact tables f1 & f2 in source.
    Now when i drag different columns from different fact tables(that are in TEST logical table) in report, it gives an error and not making any joins that you are mentioning.
    ERROR MESSAGE:--
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table Test) does not contain mapping for [Test.SurveyName_Id, Test.SurveyHead_Id, Test.Respondent_Id, Test.SDBusiness_Area_Id, Test.Period_Sgt_Key, Test.OBS_Id, Test.VOCBusiness_Area_Id, Test.Question_Sgt_Key]. (HY000)
    The columns mentioned in the error message are all from test logical table..some are from F1 & some from F2.

  • One dimension and two fact report in OBIEE

    Dear All,
    I have one dimension "region" and two facts (Sales value & Gross margin%). Gross margin% is logical column which has been derived from two other facts column and it's value is in range from Zero to 100.
    Now, I want to generate below report. For each gross margin% range of 5%, I want to sum the sales value for each region. Please assist (Just a small snapshot of report)
    GM%     Region_1     Region_2
    <0     254      619
    0-0.05     524      799
    Thanks & Regards,
    [email protected]

    Hi,
    Create Bins for Gross% fact column and go to pivot view place Gross% fact column into rows area,region column into columns section and sales value into measures section
    hope it works

  • Use "next" and "previous" buttons in two scroll panes

    Hello, I have a question about how to use next and previous buttons in two scroll panes. In fact, I plan to display two similar files (HTML) in two scroll panes seperately. the purpose is to find their differences, highlight these differences and finally traverse these differences one by one by using next and previous buttons.
    To realize this function, how should I mark their differences so that next and prevous buttons can recognize their locations? does anyone have idea?
    Thank you very much.

    Can "focus" resolve this problem? But how should I add focus to a line in one HTML files? Thank you.

  • Just bought my iphone 4S today and i have noted that it is heating up excessively even after mild usage especially on the side of sim card entry,moreover it is not providing good coverage as compared to my previous iphone 3 GS,siri hardly works,help plz

    Hi,This is Dr Mohammad Bashir Ahmed from united arab emirates,I just got my iphone 4S today and i am really disappointed because its coverage is very poor as compared to my previous iphone 3 GS,i used my iphone 4S today in same areas of my house where i was using my iphone 3GS and most of the times 3G network doesnt work and i am unable to use it even it takes very long time to open a simple email without any attachment,i called my network service provider (DU)also but they told me there is no issue of coverage in my area,moreover my iphone 3GS is working fine in same area,2ndly a strange thing is happening,it gets heated very quickly on sim card side and even i feel difficult to hold it for long because of too much heat,i was excited about SIRI which hardly works,so plz tell me should i return this set or what?

    Hi,This is Dr Mohammad Bashir Ahmed from united arab emirates,I just got my iphone 4S today and i am really disappointed because its coverage is very poor as compared to my previous iphone 3 GS,i used my iphone 4S today in same areas of my house where i was using my iphone 3GS and most of the times 3G network doesnt work and i am unable to use it even it takes very long time to open a simple email without any attachment,i called my network service provider (DU)also but they told me there is no issue of coverage in my area,moreover my iphone 3GS is working fine in same area,2ndly a strange thing is happening,it gets heated very quickly on sim card side and even i feel difficult to hold it for long because of too much heat,i was excited about SIRI which hardly works,so plz tell me should i return this set or what?

  • Using two facts of two different star schemas and conformed dimensions

    Hi,
    I've been working as developer and database designer for years and I'm new to Business Objects. Some people says you can not use two facts of two different star schemas in the same query because of conformed dimensions and loop problems in BO.
    For example I have a CUSTOMER_SALE_fACT table containing customer_id and date_id as FK, and some other business metrics about sales. And there is another fact table CUSTOMER_CAMPAIGN_FACT which also contains customer_id and date_id as FK, and some  other business metrics about customer campaigns. SO I have two stars like below:
    DIM_TIME -- SALE_FACT -- DIM_CUSTOMER
    DIM_TIME -- CAMPAIGN_FACT -- DIM_CUSTOMER
    Business metrics are loaded into fact tables and facts can be used together along conformed dimensions . This is one of the fundamentals of the dimensional modeling. Is it really impossible to use SALE_FACT and CAMPAIGN_FACT together? If the answer is No, what is the solution?
    Saying "you cannot do that because of loops" is very interesting.
    Thank you..

    When you join two facts together with a common dimension you have created what is called a "chasm trap" which leads to invalid results because of the way SQL is processed. The query rows are first retrieved and then aggregated. Since sales fact and campaign fact have no direct relationship, the rows coming from either side can end up as a product join.
    Suppose a customer has 3 sales fact rows and 2 campaign fact rows. The result set will have six rows before any aggregation is performed. That would mean that sales measures are doubled and campaign measures are tripled.
    You can report on them together, using multiple SQL passes, but you can't query them together. Does that distinction make sense?

  • I've updated Firefox today and unfortunately my previous bookmarks disappeared . how can I retrieve my previous bookmark list?

    I updated Firefox today and all my previous bookmark list disappeared. I tried to use the "import and backup" tab and followed the directions of the Firefox page to backup and restore my previous bookmarks. Unfortunately, nothing happened. Could you please help me with possible advice/guidance on how to resolve this? This is the second time this happens, always when Firefox receives updates..

    You appear to be using the Developer Edition / Aurora pre-release version, which creates a new Profile upon installation or update on the Aurora channel. Open '''Options > General''' and tick or untick the box at the top which says '''Allow Firefox Developer Edition and Firefox to run at the same time'''. Once you restart ''[as told to]'' you will "toggle" over to the other Profile, where your bookmarks are - ''hopefully''.
    If you don't like "updates", why are you using an '''alpha-2''' version that receives an update every day?

  • I am a fitst time user of the new airport extreme time capsule 2TB. I have a mac book pro and an imac. I installed the router today and got my computers online wirelessly. BUT I cannot get my previous wireless printers to connect with the router.

    I am a first time user of the new airport extreme time capsule 2TB. I use a macbook pro and imac. I installed the router today and got on wirelessly. BUT I cannot get my 2 printers that were previously wireless to find the router signal. The worked fine on my current set up OS Mounitain Lion 10.8.4.  Apple tells me it is the printer mfr issue and printer companies tell me it is apple issue. Any help appreciated.

    birdmanjay wrote:
    ... Apple tells me it is the printer mfr issue and printer companies tell me it is apple issue.
    Arguably, they're both right.
    Changing your router changes everything, so your best course of action is to research the respective printer's documentation and determine how to reset them to factory default condition. Then, add them again using System Preferences > Print & Scan.
    For that, I recommend you first "reset the printing system" according to these instructions: Mac OS X: How to reset the printing system. Its instructions for Lion are identical to those for Mountain Lion.
    As the article states, it will remove all your existing printers, leaving the Mac's printing system in a similar "factory default" condition ready for you to create a new print queue for each printer, which you should probably do.
    Apple's printing support documents contain a great deal of redundancy, but this one may be a good place to start: OS X Mountain Lion: Set up a printer to print wirelessly

Maybe you are looking for