Computation based on the drilling of a time hierarchy

Hi,
I have a cube with two dimensions A, B and two measures C, D.
B is a date and I have values for each day of year.
I have a classic time hierarchy Year->Quarter->Month->Day for B and A has also some other hierarchy.
The report shows A, B where the user can drill down using the hierarchies and a computation.
The computation that I must do is: the value of C at the beggining of the period plus the sum of D in the period.
My problem is how to get the C at the beggining of the period since I do not know at runtime how far in the time hierarchy the user has drilled down.
When I know the grouping I can do something like
SUM(CASE WHEN B.day = B.Calendar Year Start Date THEN C ELSE 0 END)
or
SUM(CASE WHEN B.day = B.Calendar Month Start Date THEN C ELSE 0 END)
to calculate the value of C at the beginning of the period but i do not!
I cannot use the RANK function because it needs a PARTITION BY and I do not know how far to partition... year? month? day ?
Example data
A B C D
a 1/1/2008 5 6
a 2/1/2008 4 12
a 3/1/2008 8 4
a 1/2/2008 11 1
b 1/1/2008 2 7
b 2/1/2008 7 2
b 1/2/2008 12 31
So, if the user selects Year I sould get as result
a 2008 5 + sum(D in 2008 for a) (where 5 is the value of C for a at 1/1/2008 for a)
b 2008 2 + sum(D in 2008 for b)
If the user drills down to Month I should get
a 01/2008 5 + sum(D in 01/2008 for a) (where 5 is the value of C for a at 1/1/2008)
a 02/2008 11 + sum(D in 02/2008 for a) (where 11 is the value of C for a at 1/2/2008)
b 01/2008 2 + sum(D in 01/2008 for b) (where 2 is the value of C for a at 1/1/2008)
b 01/2008 12 + sum(D in 02/2008 for b) (where 12 is the value of C for a at 1/2/2008)
I just started building reports with Discoverer so I might be missing something. Please help!

Thank you for the information about this. I now have a chart that displays based on a value the user enters into a text box.
It looks like I have to delete a chart and then add it again, this time with the WHERE clause I would like to use. For some reason or other I have had difficulty modifying an existing chart in this way.
Thank you again.

Similar Messages

  • Weird behaviour when drilling down in time hierarchy

    Hi Experts,
    We have time hierarchy
    year--->quarter--->month--->week--->day.
    But when im drilling down from Quarter it is showing the week level and not the month level and then again if i m trying to drill down from quarter then it is showing the month.
    What can be the issue here?
    Regards

    Hi,
    just check what u have set into preferred drill path tab for Logical level quarter.
    Regards,
    Vikas
    Edited by: user7312087 on Jul 7, 2009 12:27 AM

  • HT4628 I upgraded to the Mavericks update recently, and my computer disconnects from the wi-fi every time it goes to sleep now.

    It never used to disconnect so frequently or quickly. It is extremely annoying. Why does it suddenly keep disconnecting with this new update?

    Words cannot describe how angry this problem makes me. How can world's largest tech company not been able to fix their biggest bug for this many months now?!?!
    All these forums are overflowing with the same **** problem: WIFI DOESN'T CONNECT AFTER COMING BACK FROM SLEEP ON MAVERICKS.
    How many thousands of people have to post the same godddamn problem for how long?
    And no, disconnecting Bluetooth doesn't help (even if it did, its not an acceptable solution). I took my MacBook Air to Apple store twice already and they cannot help either.
    aaaAAAAaAaaAAaaarrrrghhh, I'm going to go insane from this problem.
    I miss Steve.. he wouldn't let something like this go on for this long. Can a half a trillion dollar company pay attention to its own support forums or at least google "wifi-not-connecting-after-sleep-mavericks" and realize what incompetent company you have become?!

  • Calculation of KFs at query run-time based on Characteritics Drill-down

    Hello All,
    I have an Important Issue which I need to solve but got stuck.
    The report requirement is that we need calculate the KF values based on the drill-down selection in the report at run-time.
    Say for eg: if the user is drilling-down the report by customer, plant or company code or any thing else other than material group...we need to calculate / Include KF values for only Materail Group  = "A" and if we are at the materail group level we need to calculate all the material groups which includes A, B, T and so on.
    Please suggest what are the avialable options for me like using virtual key figures. please provide me with some sample codes.
    your help will be highly appricated.
    thanks,
    Pra

    any toughts....Pra

  • App is user-based rather than computer-based?

    One thing I am really concerned about (and I really hope I am wrong) is that FCPX and Motion seem to be user based now rather than computer based. The structure for effects and such which I am concerned will affect how multiple accounts on the same machine will access the same features.
    Has anyone played with this or noticed any change in the directory structure and placement of plugins, effects, generators etc. from the main librbary/application support/ that would affect this?  Have some things been moved to the app package instead?
    Moving forward I just want to know that when I have effects, plugins, generators, etc. that they are accessible to everyone on the computer.  Perhaps I have a funky install and need to reinstall.
    Tell me I am wrong! Please.

    Thanks Tom.  I thought and was hoping I was wrong.  The few I have installed were setup for user-based installation except for FXFactory.  Just wanted to be certain.  I thought that would have been a change almost as bad as dropping FCS for sale the day of the FCP X release.

  • Redircmp based on the computer name

    Hi Folks,
    How can I move computers objects to a specific OU when joining to a domain, based on the initial letters before the -? As an example we have a naming convention that is like this: MLUK-ldake CVGBA-mrossi
    Thanks,
    Simon Rech
    Junior System Engineer at Vitec Group plc

    There is no built-in feature to do this, but,
    you can pre-create the computer accounts in the desired OU,
    you can stipulate the OU to create the comp acct in, at the time of joining,
    you can create the comp acct in the default container/OU for your domain and move it after creation.
    some of the methods will require advanced/custom coding/scripting, advanced/custom domain-join methods, and/or webservices.
    what method are you using to perform the domain-join? are you using Windows setup? offline domjoin? MDT? ConfigMgr? WDS? Other?
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Query to print Which Shift based on the time

    Need to sort and sum data based on the shifts in our department....
    First shift runs from 4:50 am to 2:45 pm, second shift runs from 3:00 pm to 1:00 am and any time in between is the break time.
    I cannot get the data to print first shift , break time and second shift correctly
    Sample Data :
    DROP TABLE TIME_SHIFT CASCADE CONSTRAINTS;
    -- TIME_SHIFT (Table)
    CREATE TABLE TIME_SHIFT ( TRX_DATE DATE ) ;
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('10/03/2011 10:30:23', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('12/30/2011 11:40:02', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('12/30/2011 23:55:10', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('12/30/2011 16:54:15', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('10/03/2011 10:26:10', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('10/04/2011 00:30:08', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('10/04/2011 02:47:08', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('10/12/2011 15:30:08', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('10/04/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('10/04/2011 12:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TIME_SHIFT (TRX_DATE) Values (TO_DATE('11/22/2011 03:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    COMMIT;
    SELECT TO_CHAR (trx_date, 'MM/DD/YYYY') ,TO_CHAR (trx_date, 'HH:MI:SSAM')
    -- (case
    -- when TO_CHAR(trx_date,'HH24:MI:SS') between '04:50:00' and '14:45:00'
    -- then 'FIRST SHIFT'
    -- when TO_CHAR(trx_date,'HH24:MI:SS') between '15:00:00' and '01:00:00'
    -- then 'SECOND SHIFT'
    -- else 'BREAK TIME'
    -- end
    -- ) WHICH_SHIFT
    FROM TIME_SHIFT ;
    Expected result :
    10/03/2011        10:30:23AM     FirstShift
    12/30/2011        11:40:02AM     FirstShift
    12/30/2011        11:55:10PM     SecondShift
    12/30/2011        04:54:15PM     SecondShift
    10/03/2011        10:26:10AM     FirstShift
    10/04/2011        12:30:08AM     FirstShift
    10/04/2011        02:47:08AM     BreakTime
    10/12/2011        03:30:08PM     SecondShift
    10/04/2011        12:00:00AM     SecondShift
    10/04/2011        12:00:00PM     FirstShift
    11/22/2011        03:00:00AM             BreakTimeThanks for the help in advance.

    Hi,
    In everyday speech, when we hear "Between 3:00 PM and 1:00 AM", we understand that it means one range of 10 consecutive hours. That's not how the SQL BETWEEN operator works, however. "x BETWEEN y AND z" in SQL is exactly equivalent to "x >= y AND x <= z". If y < z, it never be TRUE.
    Here's one way to do what you want:
    SELECT     TO_CHAR (trx_date, 'MM/DD/YYYY')
    ,     TO_CHAR (trx_date, 'HH:MI:SSAM')
    ,     CASE
             WHEN  TO_CHAR (trx_date, 'HH24:MI:SS') BETWEEN '04:50:00'
                                                  AND         '14:45:00'
             THEN  'FIRST SHIFT'
             WHEN  TO_CHAR (trx_date, 'HH24:MI:SS') BETWEEN '01:00:01'
                                                  AND         '14:59:59'
             THEN  'BREAK TIME'
             ELSE  'SECOND SHIFT'
         END               AS which_SHIFT
    FROM      time_shift
    ; This is close to what you tried, which was
    (1) see if it's First Shift
    (2) if not (1), see if it's Second Shift
    (3) if not (1) or (2), it must be Break time
    The problem with that is that, as far as SQL is concerned, going just by HH24:MI:SS, the Second shiift is two disjoint periods, and you have to test for each one separately. The query above reverses the last two tests:
    (1) see if it's First Shift
    (2) if not (1), see if it's Break Time
    (3) if not (1) or (2), it must be Second Shift
    It would be a little more coding, but perhaps clearer, to do it this way
    ,     CASE
             WHEN  TO_CHAR (trx_date, 'HH24:MI:SS') BETWEEN '04:50:00'
                                                  AND         '14:45:00'
             THEN  'FIRST SHIFT'
             WHEN  TO_CHAR (trx_date, 'HH24:MI:SS') BETWEEN '15:00:00'
                                                  AND         '24:00:00' -- or '23:59:59', if you prefer
               OR  TO_CHAR (trx_date, 'HH24:MI:SS') BETWEEN '00:00:00'
                                                  AND         '01:00:00
             THEN  'SECOND SHIFT'
             ELSE  'BREAK TIME'
         END               AS which_SHIFT I wish we could mark questions as "Correct" or "Helpful". You provided a good set of sample data in a useable form (you even included DROP TABLE and COMMIT statements), you gave a clear explanation of the problem with the desirred results, and you showed what you had already tried. Lots of people who have used this forum for years haven't learned to do that yet. Keep up the good work!
    Don't forget to mention which version of Oracle you're using. In this example, it may not matter. (The query above will work in Oracle 8.1 or higher.) But it never hursts o say something like "I'm using Oracle 10.2.0.3.0".
    Edited by: Frank Kulash on Dec 1, 2011 12:23 PM

  • I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen.  I've rebooted, I've reinstalled several times and get the same result.  Two days wasted!

    I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen.  I've rebooted, I've reinstalled several times and get the same result.  Two days wasted and I can't use my computer!!

    I don't know if you've already resolved your problem, but I had the same thing, it took me 6 hours to fix it. I had the exact same as you, installed the update and then it went to a white screen. After trying start up holding down cmmd r or holding down the alt key to try to install it again, nothing worked, same result every time. Then an angel came to me here somewhere but I can't find it now to thank him. Start in safe mode, press shift once you hear the start up chime and hold it down until you hear it again. Installation completion box came up and it was working. turn off computer and start up again normally and all is well. Except my final cut pro x doesn't work with it, have to update that now too. same as when I updated to mavericks.
    Hope this helps.

  • I have 2 ipods,one for music and the other for old time radio shows.Each had their own file.My computer crashed and I had to buy a new one.Now both ipod files are merged into one.How do I seperate them.

    I have 2 ipods,one for music and the other for old time radio shows.Each had their own file.My computer crashed and I had to buy a new one.Now both ipod files are merged into one.How do I seperate them on the computer?

    Hi Craig
    Unfortunately, in your case, there isn't really a way to separate them as far as I can think.
    You could try restoring from a backup, and choosing an older backup perhaps
    Cheers

  • TS4020 I live in a house with multiple iCloud users.  When they try to turn on "Find my computer"  they get the message that they will have to disable my "find my computer" setting in order to enable theirs.  How can they all be enabled at the same time?

    I live in a house with multiple iCloud users.  When they try to turn on "Find my computer"  they get the message that they will have to disable my "find my computer" setting in order to enable theirs.  How can they all be enabled at the same time?

    Try this support document for information on how to contact Apple and account security. Apple ID: Contacting Apple for help with Apple ID account security

  • I keep getting the following message every time i plug in my Iphone to Itunes on my windows vista computer  Itunes was unable to load data class information from sync services. reconnect or try again later.  any suggestions pls  Mario

    I keep getting the following message every time i plug in my Iphone3gs to Itunes on my windows vista computer
    Itunes was unable to load data class information from sync services. reconnect or try again later.
    any suggestions pls
    Mario

    The article says that I should upgrade to the latest iTunes. I am on the latest iTunes version.
    If you could read just a tiny little bit further, under the "Additional Information" section immediately after that, it says:
    If you are still experiencing this issue when syncing, or have not installed Xcode 4 and get this alert:
    Follow the troubleshooting steps in Mac OS X v10.5, v10.6: Resetting the SyncServices folder.
    If the issue is still unresolved, follow steps in Sync Services: Advanced troubleshooting for contact and calendar syncing.
    Have you tried those measures?

  • I downloaded TunesGoWatch by Wondershare. I deleted the app. Every time I turn on my computer I get a popup saying "TunesGoWatch" can't be opened because the identity of the developer cannot be confirmed. I deleted the app, how do I stop this popup?

    I downloaded TunesGoWatch by Wondershare. I deleted the app. Every time I turn on my computer I get a popup saying "TunesGoWatch can't be opened because the identity of the developer cannot be confirmed." I deleted the app, how do I stop this popup?  Your help is truly appreciated

    First:
     (Apple menu) > System Preferences > Users & Groups > select your account > Login Items.
    Determine if that program appears in that list. If it does, select it and then remove it from Login Items with the "–" (minus) button.
    Next:
    Select the entire line that follows (triple-click to select it), then control-click, and from the contextual menu that appears, select Services > Open:
    /Library/StartupItems/
    If the program or an alias to it appears in that folder, drag it to the Trash.
    Next:
    When you log out or shut down your Mac, de-select the checkbox that begins with the words "Reopen windows... "

  • I recently dug out my old 160gb iPod Classic. Every time I connect it to iTunes, the program freezes and/or crashes. My computer recognizes that the iPod is plugged in, (it's accesible under "My Computer") but iTunes doesn't acknowledge it, at all. Help?

    I recently dug out my old 160gb iPod Classic. Every time I connect it to iTunes, the program freezes and/or crashes. My computer recognizes that the iPod is plugged in, (it's accesible under "My Computer") but iTunes doesn't acknowledge it, at all. I've tried every single solution I've seen, and none of them work. I know the Classic is outdated, but my other iPod doesn't have nearly as much room. Can anyone help with this?

    See Corrupt iPod classic.
    tt2

  • I'm using a new computer and to open one website I have to answer the security questions each time saying that the site doesn't recognize this computer.

    Each time I try to open my "ubt" website, I get a message that says the site does not recognize this computer so I have to answer the security questions each time. I get the message "You are attempting to log in to your account from a computer that we do not recognize..." All other websites work just fine. The Mac store person could not figure it out. This site works on Safari, but I prefer Firefox.

    The ipod is not a backup device. The music sync is one way - computer to ipod.  The only exception is itunes purchases:  Without syncing:File>transfer Purchases
    Copy everything from your backup copy of your  old computer to your new one.

  • How to calculate Goods issue date based on the time of delivery

    Hi SAP Gurus,
    I seek your help/suggestion for the given scenario.
    The user requires calculating the GI date based on time of delivery.
    Based on the delivery priority (like Priority 1= Day 1, Priority 2= Day 2) maintained in customer master, the need is something like below-
    1st case= If Retail Customeru2019s delivery orders received before midday (Noon cut off) require to be dispatched on same working day (Day 1)
    Wholesaler customer delivery orders received before midday require to be dispatched by the next
    Working day (Day 2 Including day of receipt)
    2nd case= Retail customeru2019s delivery orders received after midday require to be dispatched by the next working day
    Wholesaler customer delivery orders received after midday require to be dispatched by on day 3
    Kindly suggest , how to proceed in this. I am new to SAP world so need ur help to tackle this.
    Thanks a lot in advance for the valuable inputs.

    What I proposed to do was,
    a. Create routes like 0 day route, 1 Day route, 2 day route etc.
    b. Route determination is based on the Shipping condition of the customer. Put in the shipping condition for the customer as 00 - immediate delivery. 01 - By Truck, 02 - By Rail, 03 - Ship etc
    c. Now, put in your route determination in such a way that routes change in the sales order with shipping condition (SC). Like, if the shipping condition is set to 00, then 0 day route comes up. Meaning immediate delivery, if SC is 01, then your normal route by truck picks up. etc.
    When the sales order is manually created, you know the time of creation. As route is one of the criteria, the material confirmation happens based on number of days you put in the route to reach the destination. Now that you have the material available for today's delivery, the delivery program can be run to create it, or it can be manually created.
    Now, when you configure the route you have to specify 'Transit duration in calendar days'.
    When you have the sales order created electronically (say thru EDI), then, you may have to ask them to send in shipping condition. Else, you have to modify the function module Idoc_input_orders in such a way that if the sales order creation time is < 12 PM, then put shipping condition as 00, else copy what ever is there in the customer.
    If you do not want to check the time manually when the user creates the sales order, then you may have to use the user exit MV45AFZZ (and I think you can use Save_order_prepare) to check the time and change the shipping condition. By this you will avoid extra coding in Idoc_input_orders and also need not bother if the user changed the route or not.
    Hope my explanation helps.
    Regards,
    Mukund S

Maybe you are looking for