Getting the Latest status with respect to DATE entered

Hi guyz, kindly help me in this scenario:
I have a DSO and a CUBE....
DSO:
cust
status code
status date
RAW DATA
cust               status code               status date
payer1                    1                      12/31/2013
payer1                    3                       1/3/2014
payer2                    4                       12/15/2013
payer2                    2                        1/10/2014
CUBE:
cust
0calday
qty (KF)
RAW DATA
cust                    0calday                    qty
payer1                1/1/2014                    10
payer1                1/2/2014                    20
payer1                1/3/2014                    30
payer1                1/4/2014                    40
payer1                1/5/2014                    50
payer2                1/1/2014                    60
payer2                1/2/2014                    70
payer2                1/3/2014                    80
payer2                1/4/2014                    90
payer2                1/5/2014                    100
I need to have this report: (for example I entered 1/1/2014 - 1/5/2014)
cust               status code               0calday              qty
payer1                   1                       1/1/2014              10
payer1                   1                       1/2/2014              20
payer1                   3                       1/3/2014              30
payer1                   3                       1/4/2014              40
payer1                   3                       1/5/2014              50
payer2                   4                       1/1/2014              60
payer2                   4                       1/2/2014              70
payer2                   4                       1/3/2014              80
payer2                   4                       1/4/2014              90
payer2                   4                       1/5/2014              100
Is this possible in query? Or do I need to do this in start routine?
By the way, I can already show the QTY figures, I used CONSTANT SELECTION..My problem now is how to the STATUS CODE..How will I do this?
Thank you!
Loed

Loed,If you are flexible with modeling level changes then i would suggest to stamp the values of status and status date against payer in cube.
Add the two objects ion cube.Do a lookup on the DSO from cube in End routine and based on payer fetch the value of status and status date against each payer.
Now once you have the complete data in the cube then at reporting level to get the correct status based on the validity dates you can refer my blog.
Status of Tickets based on their Dates
PS:If you need assistance in the coding part then let me know.
Regards,
AL

Similar Messages

  • Query to find the latest record with respect to the current status

    Dear gurus
    I have the following data in a table
    Customernum
    bkcode
    reqtdate
    Prevstat
    currstat
    The data will be like this
    CustomerNum bkcode reqdate prevstat currstat
    5900 1 03-Aug-12 0 1
    5900 1 06-Aug-12 1 0
    5900 5 22-Jun-12 0 1
    If a customer has an issue to solved, a record is added with bkcode , register date and currstat will be 1
    If the issue is resolved for the bookingcode,a new record is added, the currentstatus will become 0. and prev stat will show 1. Row no 1 and 2 reflects this case
    If this table is queried for finding the unresolved issues. the output should be only the Last row of the above example. since issue with bookingcode 1 has been resolved
    I have trying hard to get this thing confused what to use Lead or Max
    Kindly guide me

    Hi,
    one way here:
    WITH mytable(CustomerNum, bkcode, reqdate, prevstat, currstat)
    AS
       SELECT 5900, 1, TO_DATE('03-Aug-12', 'DD-Mon-YY'), 0, 1 FROM DUAL UNION ALL
       SELECT 5900, 1, TO_DATE('06-Aug-12', 'DD-Mon-YY'), 1, 0 FROM DUAL UNION ALL
       SELECT 5900, 5, TO_DATE('22-Jun-12', 'DD-Mon-YY'), 0, 1 FROM DUAL
    SELECT CustomerNum, bkcode, reqdate, prevstat, currstat
      FROM (SELECT a.*
                 , ROW_NUMBER() OVER (PARTITION BY CustomerNum, bkcode
                                           ORDER BY reqdate DESC) AS rn
              FROM mytable a
    WHERE rn=1
       AND currstat=1;
    CUSTOMERNUM     BKCODE REQDATE     PREVSTAT   CURRSTAT
           5900          5 22-JUN-12          0          1Regards.
    Al
    Edited by: Alberto Faenza on Dec 18, 2012 5:23 PM
    Changed again!! Previous logic was wrong

  • Can I get the latest Aperture with Maveric update?

    "As a result of Apple's changes, all users with older versions of Aperture, iWork or iLife installed -- even if acquired through less-than-ethical means -- should be able to upgrade to the latest versions through the Mac App Store"
    I bought Aperture on a DVD disk and got V2.1.4.
    I just upgraded to Maveric. My App Store Aperture 3 is available for £56.00 not free as suggested by Apple.
    Does any-one know when they said "Old" version it only covers Aperture 3 old versions not the preceding Apertures?
    Can some one with understanding tell me if I could upgrade to Aperture 3 for free?
    Regards

    Can some one with understanding tell me if I could upgrade to Aperture 3 for free?
    The upgrade from Aperture 2 to three has always been a paid upgrade. There are no free updates available from Apple, to upgrade from version two to three.
    My App Store Aperture 3 is available for £56.00 not free as suggested by Apple.
    If your Aperture version should now been eligible for a free upgrade to the latest version, you should see this on the "Updates" tab of the App Store.
    It can take a while to appear there.

  • HT4972 I have iPad running iOS 5.1.1 and when i try to update to the latest iOS with iTunes I get "iOS 5.1.1 Your software is up to date"

    I have iPad running iOS 5.1.1 and when I try to update to the latest iOS with iTunes I get "iOS 5.1.1 Your software is up to date"
    It looks like some Apps I was using are no longer working properly under iOS 5.1.1

    Sorry, the original iPad can only be updated to IOS 5.1.1

  • Getting the latest dates

    Hello,
    I have simple question ....i dont know why i m brain dead today...
    I m trying to get the latest date for the each id
    with test_data as(
    select '001'id, 'xyz'name, '1/1/2009'start_date from dual union all
    select '001',  'abc', '1/2/2099' from dual union all
    select '001',  'def', '1/3/2009' from dual union all
    select '001',  'ghi', '1/4/2009' from dual union all
    select '001',  'jkl', '1/5/2009' from dual
    The output i m looking for just one record with latest date
      with result as
         select '001',  'jkl', '1/5/2009' from dual 
    i tried this
    select id,name, greatest(start_date) from test_data
      group by id,name,start_date
    It gives me output ...which i m not lookg for
      with t as
         select '001',  'abc', '1/3/2009' from dual union all
         select '001',  'ghi', '1/4/2009' from dual union all
         select '001',  'jkl', '1/5/2009' from dual
       )select * from t
       I was wondering if we have any function's in oracle PL/SQL to do these kind of stuff's
    Any suggestions is greatly appriciated!! Thank you sio much!!
    Edited by: user642297 on Mar 12, 2010 12:21 PM

    SQL> with test_data as(
      2  select '001'id, 'xyz'name, '1/1/2009'start_date from dual union all
      3  select '001',  'abc', '1/2/2099' from dual union all
      4  select '001',  'def', '1/3/2009' from dual union all
      5  select '001',  'ghi', '1/4/2009' from dual union all
      6  select '001',  'jkl', '1/5/2009' from dual union all
      7  select '002',  'ghi', '1/4/2009' from dual
      8  )
      9  select id, max(start_date), max(name) keep (dense_rank first order by start_date desc)
    10  from test_data
    11  group by id;
    ID  MAX(STAR MAX
    001 1/5/2009 jkl
    002 1/4/2009 ghiMax
    http://oracleitalia.wordpress.com

  • Reg: Getting the latest or last saved data from the table

    Hi,
    I'm having a table, which is getting updated whenever something is saved.
    Now i want to get the latest or last saved details to be displayed or the details of the row with greatest Id.( i.e, the Id. will be greatest for the last saved)
    please help me out with code to do this...
    Thanks & Regards,
    Suresh

    Hi Suresh,
    This could be done either through the webdynpro or the back end function module itself.
    If another field of type date/time is present in the table, u can save the current date and time along with the data in the table, and sort it in descending order of time. so that whenever u refresh the page the latest record is always in the first row,
    if u want to do it through webdynpro, u can also sort the table based on the date so that u get the latest record that was saved.
    Another solution is that u can maintain a serial number sort of thing the table which helps u identify the latest record
    Hope this helps u.
    Regards,
    Poojith M V

  • HT2105 Continually get a message saying "We are experiencing technical difficulties, please try later" when trying to set up allowances. Not very helpful. Any ideas. I am running the latest itunes with Windows 7 Professional.

    Continually get a message saying "We are experiencing technical difficulties, please try later" when trying to set up allowances. Not very helpful. Any ideas. I am running the latest itunes with Windows 7 Professional.

    Not a solution yet, but received the following from one of the tech people I've been e-mailing back & forth with.
    "I'm sorry that you have been unable to submit your podcast. The podcast submission form is currently offline. When trying to submit the podcast you will receive this message "We are Currently Experienced Technical Difficulties". Once the issue has been resolved, I would be glad to inform you.
    Apple is currently working toward a resolution for the issue you have reported. You will receive an email after the matter has been investigated and further information is available."
    Who knows, maybe the problem isn't with my feed after all.

  • What is the best way to "upgrade" a powerbook g4 with a powerpc chip?  it seems that many things don't work or aren't supported these days.  can't update my iphone, download video, etc.  can i get the latest software?  thanks.Ask your question.

    what is the best way to "upgrade" a powerbook g4 with a powerpc chip?  it seems that many things are not supported these days.  can't download software, update my iphone, download video, etc.  can i get the latest software?  thanks for the help!

    Mac OS X 10.5 Leopard installation system requirements
    http://support.apple.com/kb/TA24950
    Leopard is no longer available at the Apple Store but may be available by calling Apple Phone Sales @ 1-800-MY-APPLE (1-800-692-7753).
    If you can't obtain a retail install DVD from Apple, look on eBay or Google the installer part numbers to possibly find at an on-line store. Here's what to look for:
    MB427Z/A  Leopard 10.5.1 install DVD
    MB576Z/A  Leopard 10.5.4 install DVD
    MB021Z/A  Leopard 10.5.6 install DVD (single user)
    MB022Z/A  Leopard 10.5.6 install DVD (5-user family pack)
    Installing Mac OS X 10.5 Leopard
    http://support.apple.com/kb/HT1544
    Mac OS X 10.5 Leopard Installation and Setup Guide
    http://manuals.info.apple.com/en/leopard_install-setup.pdf
    After you install the base 10.5, download & install the 10.5.8 combo update at http://support.apple.com/downloads/Mac_OS_X_10_5_8_Combo_Update
    The DVD should look like this
    Caution - Leopard does not support classic mode. So, if you currently open OS 9 apps in classic mode, you won't be able to do this if you upgrade to Leopard.
     Cheers, Tom

  • How to get the latest Change date and time of a M.O. from View VIAUFKST

    Hi All,
    I want to get the latest date and time of a M.O. from view
    VIAUFKST. I have written the query like this...
      SELECT AUFNR
             AEDAT  " Changed Date
             AEZEIT " Changed Time
        FROM VIAUFKST
        INTO TABLE I_VIAUFKST
       WHERE AEDAT >= W_LASTRUN_DATE
       ORDER BY AEDAT DESCENDING.
    but its not giving me right results... Pls help me out on this or suggest me the right approach to achieve the same...As this is very critical issue...
    Advance Thanks and Points Gauranteed...
    Suresh

    > SELECT AUFNR
    >          AEDAT
    >          AEZEIT
    >     FROM VIAUFKST
    >     INTO TABLE I_VIAUFKST
    >    WHERE AEDAT >= W_LASTRUN_DATE.  
    >
    >   IF NOT I_VIAUFKST[] IS INITIAL.
    >    SORT I_VIAUFKST BY AEDAT AEZEIT DESCENDING.
    >    READ TABLE I_VIAUFKST INDEX 1.
    >   ENDIF.
    >
    > The above statement is giving me different results...
    > such as...
    >
    >  1. 30/11/2005 19:20:11
    >  2. 29/11/2005 22:10:09
    >  3. 30/11/2005 20:56:09
    >  4. 28/11/2005 23:10:09
    >
    > by using the above SORT statement i am getting the
    > fourth record as the latest, where as it should give
    > me the third record....
    >
    > Please advise,
    > Suresh.
    Hi Suresh,
    The reason why you are getting this result is because the system is interpreting the DESCENDING only for AEZEIT not for both. Change it to
    SORT I_VIAUFKST BY AEDAT DESCENDING AEZEIT DESCENDING

  • Getting the Latest and previous date

    Hi GURUs
    Good Morning.
    I need some help for my program. I need to get the latest price of the current month and the last maintained price of the previous month.
    Can someone help me with my program?.
    Thank you in advance.
    Regards,
    dranel

    >
    dranel wrote:
    > Hi Sourav,
    >
    > Here is the table that I used,
    >    KONP,   A004,  KONV,  VBRK, mara, mard and mseg.
    >
    >
    > thank you.
    Hi dranel,
      What about Your Previous Post about BDC ??? Able to solve ???
    Regards,
    Suneel G

  • Hello, trying to download the latest iTunes software version, a pop up comes with a "invalid signature" message. Try to do download only with the same results. I can buy and download from iTunes but can't  get the latest version?

    Hello, trying to download the latest iTunes software version, a pop up comes with a "invalid signature" message. Try to do download only with the same results. I can buy and download from iTunes but can't  get the latest version?

    Transfer Purchases  = iTunes > File > Transfer Purchases
    http://support.apple.com/kb/HT1848

  • Master Child tables how to get the latest rows from both

    Hi,
    Need some help with the sql. I have two tables Master & Child. In my Master table I have multiple rows for the same record and in the child table also multiple rows for the same master row how can I get the latest one's from both.
    For example Data in my Master table looks like
    CONT_ID                  SEQ_NUM        DESCRIPTION
    1                         189             Update 2
    1                         188             Update 1
    1                         187              NewNow in the child table for the same CONT_ID I may have the following rows
    CONT_ID                   UPDATED_DATE                                     STATUS
    1                        3/16/2010 2:19:01.552700 PM                          P
    1                        3/16/2010 12:29:01.552700 PM                         A
    1                        3/16/2010 12:29:01.552700 PM                         P
    1                        3/16/2010 12:19:01.552700 PM                         NIn my final query how can I get the row with seq_num 189 as it's the latest in Master table and from child table the row with status of P as it's the latest one based on the time. Here is the query i have but it returns the latest row from the child table only and basically repeats the master table rows as opposed to one row that is latest from both:
    Thanks

    Hi,
    You can use the analytic ROW_NUMKBER function to find the latest row for each cont_id in each table:
    WITH     got_m_rnum     AS
         SELECT     cont_id,     seq_num,     description
         ,     ROW_NUMBER () OVER ( PARTITION BY  cont_id
                                   ORDER BY          seq_num     DESC
                           ) AS m_rnum
         FROM    master_table
    --     WHERE     ...     -- any filtering goes here
    ,     got_c_rnum     AS
         SELECT     cont_id, updated_date,     status
         ,     ROW_NUMBER () OVER ( PARTITION BY  cont_id
                                   ORDER BY          updated_date     DESC
                           ) AS c_rnum
         FROM    child_table
    --     WHERE     ...     -- any filtering goes here
    SELECT     m.cont_id,     m.seq_num,     m.description
    ,     c.updated_date,     c.status
    FROM     got_m_rnum     m
    JOIN     got_c_rnum     c     ON     m.cont_id     = c.cont_id
                        AND     m.m_rnum     = c.c_rnum
                        AND     m.m_rnum     = 1
    ;If you'd like to post CREATE TABLE and INSERT statements for the sample data, then I could test this.
    If there happens to be a tie for the latest row (say, there are only two rows in the child_table with a certain cont_id, and both have exactly the same updated_date), then this query will arbitrarily choose one of them as the latest.

  • How can we get the Latest Resource Assigned in the Approval Form

    I was wondering if there is any way to get the Latest Assigned Resources to a User in my Approval Form.
    I tried this <ref>waveset.resourceAssignments</ref> but it returned all the Resources assigned to a User. While creating a User with Resource Assigned it won�t be problem. While Update when a User is assigned a Resource & it comes for Approval to the owner, all the Previously assigned resources shows up. How can I get only the Latest Resource Assigned.
    Can anyone provide some hints on this..

    idm_guy, if you could elaborate more on what you mean with latest resource assigned it would help - but there are a number of options (if i interprent you correctly to solvethis). My guess is that the easiest way would be to determine if:
    waveset.accounts[<iterate through resources>].created = true or false
    and if
    waveset.accounts[<resource>].lastPasswordUpdate = <last updated date>
    The latter is of course only applicable to resource where you set a password. This value will be updated whenever you set the password and could be a possible value to check against.
    If the account is not created yet but assigned it might be another possibility to check, but again - clairfy a bit about what you mean with "Latest Resource Assigned".
    /Anders

  • How to get the latest and valid BOM item entry from STPO

    hi,
    may i know with what condition we can get the latest and valid BOM item entry from STPO table?
    i have STLNR and IDNRK as a input. But i realized that it would return multiple entry due to the combination of  valid-from and valid till date.
    can i use stlnr,idnrk and stpoz (with the latet counter) to get the latest and valid BOM entry?
    thank you.

    Hi
    You can get the latest BOM either by using the latest valid from date DATUV or latest internal counter STPOZ
    Regards
    Shiva

  • How to get the latest credit limit values per each customer in the report.

    Hi All,
    Can anybody give me an idea on how to get the latest credit limit values per each customer in the report.
    I have below requiremnt.
    I have cube which is having transactional data on document and customer level .and it also having master data info object in the cube which is credit management view having all the customer numbers .
    This credit management view is master data info object having credit limit key figure as attribute.These credit limit are per each customer.
    So we need these credit limits in the report as dynamic values .(I mean whatever be the current credit limit in the master data table for that paricular customer that should show up in the reporting).
    one more thing these credit limits should roll up correctly at the HTR level.
    One HTR having number of customers .
    for example HTR 100 can have customer number 200,300,400.
    Those 200,300,400 customer credit limits should roolup correctly at the HTR 100 level.
    Example below :
    Cube DATA :
    HTR Customer Doct number Credit managment view
    100 200 10001 200
    100 200 10002 200
    100 300 10004 300
    100 300 10005 300
    100 400 10006 400
    100 400 10007 400
    100 400 10008 400
    Master data tabel (P Table)(Credit managment view)
    Credit managment view Credit limits
    200 1000.00
    300 50000.00
    400 90000.00
    Please remeber :
    We can not make these credit limits as navigational becasue these are keyfigure attributes not characteristics.
    one more thing we can not make them as charatistics because we need use these credit limits to derive other calkculation. so it is not possibel to derive calculations on charactristics .

    Create a formula variable of type replacement path with reference as attibutes of Credit management view and choose your key figure credit limit,say zcredit.
    Now create a formula or CKF and use zcredit.
    This should display the credit limit in your report as normal key figure.
    I didnot get this part "one more thing these credit limits should roll up correctly at the HTR level.", may be the above will solve this too.Try it.
    Hope this helps.

Maybe you are looking for

  • OBIEE 11G - Navigation:How to open in New page/new tab.

    Hi All, When I click on a link in report it opens another report on the same page. Instead I have to open the report in a new page/new tab. Is this feature available in obiee 11g version? If yes, could you please tell me how to make it possible? Than

  • FW adding 1 pixel to the width of my export

    Not sure what ther problem is... I have a document 772x477 and it is a rollover with 14 frames. When I bring it into dreamweaver the width becomes 773, I did a search for 773 and nothing came up, all the widths were set to 772, I also noticed the var

  • Purchase order smart forms

    i have copied the purchase order smart form and activated it and know i have the function moudule which need to be used in program but i am not shure how to do that can any one tell me how i need to write the coding for simple purchae order and then

  • Re Run Client Export Transport Request

    Dear Experts, I was trying to do system refresh of Production data to quality. While executing the transport request in quality (STMS_IMPORT) quality server abruptly stopped. Now after starting the server I am checking the status of the "Client Expor

  • Ticketmaster PDF's cannot be opened

    We are unable to open Ticketmaster PDF's (our tickets) when using Firefox. Have added several add-ons which will open PDF's from other sites but none open Tickemaster ones. Which add-on's do we need? == This happened == Not sure how often