Not getting Last year data in query

Hi All
i have created one query on cost element cube.i have two col in the query i.e amount(present year) and amount (past year).
For getting the past year data I have set the offset -12 for the fiscalyear/ period variable in the query i also restricted the fiscal year variant v3 in the amount. but i am not getting the corect value  for the past year . if i run for 2011 and 2010 for the same period i am getting right value in Amount(present year) but if i run the query for 2011 for same period i am not geting right value in amount previous year data. Kindly help me how to  get right data.

Hi Atul,
There are certain restrictions when you are reporting over multiple time frames,
1) You should not put the global restriction of the time period on which you want to display data e.g. 0CALMONTH or 0FISCPER etc.
you can put the global restriction but it should be at high granularity. for e.g. when you are reporting on Present month and last month then you can put restriction on Year, here you should take care when you are giving input as first month then last month of previous year data will not be displayed untill year is restricted for current as well as previous year.
Another thing is
2) You should not put time characteristic in drill down otherwise data aggregation doesn't happen.
If you want to take any time characteristic input then it should be included in the specific RKF only, though Input ready variables.
Regards,
Durgesh.

Similar Messages

  • Pay_us_wages_w2_v is not picking current year data?

    Hi,
    pay_us_wages_w2_v tabe is not getting current year data, only is getting previous year data.
    Like
    SELECT sum(w2_wages_tips_compensation)
    FROM   pay_us_wages_w2_v puw
    WHERE  puw.assignment_id = 40291--:assignment_id1
    AND
    puw.year     
    = '2013'--TO_CHAR(:P_PAY_DATE_END,'RRRR');
    Please let me know , if any body idea?. We have to run any Program?
    Thanks,
    Ramu

    At first I was not happy. I didnt understand how it worked. I wanted to keep my unlimited. It may not work out for everyone but it does for me.  I have two accounts. one has 5 lines and the other has two. I pay 150 for two lines on one account. I have the 30 dllr 2 gig package. Then I have a dumb phone for the second line. My other account I have 5 smartphones. I pay around 350 for that account.
    Now with the new plans I can combine BOTH accounts into one and make one BIG family plan. All the users in my account do not go over 2 gigs except one but he never goes over 5. Ill get a big data package and save some money. On top of that its UNLIMITED minutes and text which is what we use it for.  Ill be paying around 350ish with a big data package..
    That is 150 dllrs in savings!! Now since I can add usage controls I can control how much data that one person uses.
    Not sure about you guys but to me this is #winning status!

  • Using Fiscal/Year Period to get last year all months data

    Hi,
    Had a requirement to get Last Years 1-12 months data based on Fiscal/Year Period. So here i am using Fiscal/Year period as my input. Please let me know with code.
    Regards,
    Vishnu

    Hi ,
    Where you want to write code ?
    Well the basic logic will be like :
    TYPES: BEGIN OF ty_range,
    sign TYPE c LENGTH 1,
    option TYPE c LENGTH 2,
    low TYPE c LENGTH 8,
    high TYPE c LENGTH 8,
    END OF ty_range.
    DATA : t_range TYPE TABLE OF ty_range,
    w_range LIKE LINE OF t_range.
    DATA :v_lastyear type c length 4  .
    v_lastyear = sy-datum(4) - 1 .
    w_range-sign = 'I'.
    w_range-option = 'EQ'.
    concatenate  v_lastyear '001'  t into w_range-low.
    concatenate  v_lastyear '012'  t into w_range-high.
    APPEND w_range TO t_range.
    ****it will select data from source package for last one year .Internally year and period store like YYYYPPP  (2011001)
    select  SOURCE_PACKAGE WHERE 0fiscper  IN t_range.
    you can modify selection statement as per your requirement .
    hope this will be helpful .
    Regards,
    Jaya Tiwari

  • How to get Last Year Sales and YTD Sales without using AGO and TODATE?

    Hi all,
    I have got Company and Time dimensions and Sales Fact. My requirement is to get Last Year sales for each company without using AGO function and YTD without using TODATE function. (Due to performance issue as AGO and TODATE do not insert a Cache entry).
    Can someone please help me to achieve my requirement? Thanks in advance.

    Hi Satya,
    Thanks again for your reply. To start with I don't have data for the years 2012 and 2011 to test as I am using SH sample schema from Oracle. I have applied your solution but it does not seem to be working for the previous years like 2000, 2001. My requirement is to have a dashboard prompt "YEAR" and let the user choose whatever year he wants.
    Please have a look at the column formulas of my analysis (As per your solution) :
    ***here B_YEAR is replaced by CALENDAR_YEAR.  
    Amount: "F1 Sales"."Amount"
    AmountYTD:  FILTER("F1 Sales"."Amount" USING "D1 Time"."CALENDAR_YEAR" =YEAR(CURRENT_DATE))
    Amount LY: FILTER("F1 Sales"."Amount" USING "D1 Time"."CALENDAR_YEAR" =YEAR(CURRENT_DATE)-1)and the physical query generated by BI Server: (as you can see I have got a filter CALENDAR_YEAR= 2000)
    WITH
    SAWITH0 AS (select sum(T1074.AMOUNT_SOLD) as c1,
         sum(case  when T1035.CALENDAR_YEAR = TO_NUMBER(TO_CHAR(TO_DATE('2012-05-03' , 'YYYY-MM-DD'), 'yyyy'), '9999') then T1074.AMOUNT_SOLD end ) as c2,
         sum(case  when TO_NUMBER(TO_CHAR(TO_DATE('2012-05-03' , 'YYYY-MM-DD'), 'yyyy'), '9999') - 1 = T1035.CALENDAR_YEAR then T1074.AMOUNT_SOLD end ) as c3,
         T1035.CALENDAR_MONTH_DESC as c4,
         T1035.CALENDAR_YEAR as c5,
         T1035.CALENDAR_MONTH_ID as c6
    from
         TIMES T1035 /* D1 Time */ ,
         SALES T1074 /* F1 Sales */
    where  ( T1035.CALENDAR_YEAR = 2000 and T1035.TIME_ID = T1074.TIME_ID )
    group by T1035.CALENDAR_MONTH_DESC, T1035.CALENDAR_MONTH_ID, T1035.CALENDAR_YEAR)
    select distinct 0 as c1,
         D1.c4 as c2,
         D1.c5 as c3,
         D1.c1 as c4,
         D1.c2 as c5,
         D1.c3 as c6,
         D1.c6 as c7
    from
         SAWITH0 D1
    order by c3, c2 Thanks in advance.

  • Getting Last Year in @Range

    I know that using @CurrMbr here is extraneous, however I wanted to make sure it worked.
    @Range(Revenue->Dollars->@CurrMbr("Years"),@Children("Full Year"))
    This returns the specified slice of data for the current year and the children of full year, which are four quarters.
    However, this does not return last year:
    @Range(Revenue->Dollars->@Member(@PrevSibling(@CurrMbr("Years"))),@Children("Full Year"))
    I get the error:
    attempt to cross null member in function
    So how would I return the previous member in years, i.e., last year?
    Edit:
    When I use this:
    Revenue->Dollars->@Member(@PrevSibling("2012")),
    Instead of passing @CurrMbr("Years"), 2011 is passed correctly with PrevSibling. So I'm guessing that @CurrMbr("Years") is probably not returning the right type for the parameter PrevSibling needs.
    Edited by: user12268822 on Mar 10, 2013 6:31 PM

    Hi Marvin,
      For the momento you can't create MDX Dimension, only MDX Measures.
      You can create a variable in WEBI report, for the user perpective looks like a normal dimension.
      If the 0CALDAY.LEVEL01 has the name dimension DATE, you can create a variable using  the formula RelativeDate
    date RelativeDate(start_date;num_days)
    start_date: The start date
    num_days: The number of days from the start date, The num_days parameter can be negative to return a date earlier than start_date
    RelativeDate[Reservation Date];2) returns 17 December 2005 when [Reservation Date] is 15 December 2005.
    RelativeDate[Reservation Date];-3) returns 9 January 2007 when [Reservation Date] is 12 January 2007.
    106
    If you want to use MDX MEasures you can:
    Year To Date= <EXPRESSION>SUM(YTD(@Select(Key Figures\Billed Quantity)))</EXPRESSION>
    Measure on previous Member= <EXPRESSION>(@Select(Key Figures\BilledQuantity), [0CALMONTH].PrevMember)</EXPRESSION>
    Best regards,
       Fede

  • Dates -- Pulling the last year data!, which should'nt be the case.

    Need some basic SQL Help ..
    Iam supposed to pull the data based on a date column(end_time) -- Yesterday 3PM untill Today's 3PM.
    Iam getting last year's data too in additon to Current Data.
    Where am i comparing wrong??
    SELECT a.*
    FROM table a
    WHERE TO_CHAR (a.action_end_time, 'MM/DD/YYYY HH24:MM:SS') >=
    TO_CHAR (SYSDATE - 1, 'MM/DD/YYYY')
    || ' 15:00:00'
    AND TO_CHAR (a.action_end_time, 'MM/DD/YYYY HH24:MM:SS') <=
    TO_CHAR (SYSDATE, 'MM/DD/YYYY')
    || ' 15:00:00'
    ORDER BY a.end_time;

    Date math, 1 = 1 day 1 / 24 = 1 hour, trunc with no date format gives midnight
    Try this.
    select a.* from table a where
      a.action_end_time between trunc(sysdate) + (15 * 1 / 24)
                            and trunc(sysdate - 1) + (15 * 1 / 24) In your example you are comparing strings, not dates.

  • Hi all, can someone help me in getting last login date of a user in CQ5 please?

    Hi all, can someone help me in getting last login date of a user in CQ5 please?

    CQ is REST based and does not have the concept of session. So there is no feature to track login or logout details.  Most of our customers use some kind of central authentication Ex- SSO hence no need arises to have such functionality built in.  However if needed you have the ability to implement such at a project level solution. Ex:- custom login modules or auth-handler by taking project specific constraints and requirements into account

  • How to get last modified date and time of a file which is in apache server.

    Hi ,
    I need to get last modified date and time of a file in remote machine.
    This file is in remote machine which has apache server installed.
    I am trying to get this information by connecting to apache server from client by giving absolute URI of the file to file object.
    URI is got from apache server URL by using toURI method.
    when I use lastModified method , its throwing exception , because scheme of URI is not file.
    I can't give scheme as file because ftp server is not installed on that server
    Is there any other way to get this information .

    No, unless you can use an FTP client.

  • How to get last Build date of a dll in the real time target

    Info On My Project    
       I am working on LabWindows CVI 12.0 for development . This project is a real time application for hardware, which is having Phar Lap ETS as RTOS...  
    I am facing some problems while checking Build date of my Application file( .dll)
    I have tried to use GetFileDate API. But it is not supporting for realtime Target..
    So i have tried __DATE__ macro.. That also having some problems..
    How to get last Build date of a dll from the real time target  ??
    Please Help to solve this....
    Thanks
    Vaishakh A  K

    Please reply if any one have suggestion...

  • Getting last year column value from a single table

    I am having the following columns in my table
    BRANCH_CD
    YYMM
    VNDR#
    VGROUP#
    SALES_TRGT_AMT
    SALES_ACTL_AMT
    CUM_TRGT_AMT
    CUM_ACTL_AMT
    i need to get sales_actl_amt from this year and sales_actl_amt from last year from a single table
    pls help
    thank you
    Edited by: 960991 on Nov 19, 2012 11:13 PM

    Hi ashish,
    but i can't use unions in my reports.
    once view my query :
    select t.branch_cd,b.branch_e_name,t.vndr#,v.vndr_name,
    sum(nvl(t.sales_actl_amt,0)) sales_actl_amt
    from inv_sales_trgt_val t,branches b,vendor v where
    t.branch_cd=b.branch_cd and
    t.vndr#=v.vndr# and
    (t.yymm between :fiscal_month and :fiscal_month2) and
    (:fiscal_month<>trunc(:fiscal_month2,-2)) and :fiscal_month2<>trunc(:fiscal_month2,-2)) and t.branch_cd between :from_branch and to_branch and
    t.vndr# between :from_vndr and :to_vndr
    group by t.vndr#,v.vndr_name,t.branch_cd,b.branch_e_name
    order by t.vndr#,t.branch_cd;
    how can i get last year sales_actl_amt .

  • Getting last year sale , this year sale and getting there percentage

    Hi,
    I am using three query in my report
    first query : to get this year actual sales
    second query : to get last year actual sales
    third query : to get target sales
    my first query is
    select t.branch_cd,b.branch_e_name,t.vndr#,v.vndr_name,
    sum(nvl(t.sales_actl_amt,0)) sales_actl_amt
    from inv_sales_trgt_val t,branches b,vendor v where
    t.branch_cd=b.branch_cd and
    t.vndr#=v.vndr# and
    (t.yymm between :fiscal_month and :fiscal_month2) and
    (:fiscal_month<>trunc(:fiscal_month2,-2)) and :fiscal_month2<>trunc(:fiscal_month2,-2)) and t.branch_cd between :from_branch and to_branch and
    t.vndr# between :from_vndr and :to_vndr
    group by t.vndr#,v.vndr_name,t.branch_cd,b.branch_e_name
    order by t.vndr#,t.branch_cd;
    my second query
    select t.branch_cd,b.branch_e_name,t.vndr#,v.vndr_name,
    sum(nvl(t.sales_actl_amt,0)) sales_actl_amt0 ,
    sum(nvl(t.sales_actl_amt,0)) last_year_sales_actl_amt
    from inv_sales_trgt_val t,branches b,vendor v where
    t.branch_cd=b.branch_cd and
    t.vndr#=v.vndr# and
    (t.yymm between :fiscal_month-100 and :fiscal_month2-100) and
    (:fiscal_month<>trunc(:fiscal_month2,-2)) and :fiscal_month2<>trunc(:fiscal_month2,-2)) and t.branch_cd between :from_branch and to_branch and
    t.vndr# between :from_vndr and :to_vndr
    group by t.vndr#,v.vndr_name,t.branch_cd,b.branch_e_name
    order by t.vndr#,t.branch_cd;
    and my third query is
    select t.branch_cd,b.branch_e_name,t.vndr#,v.vndr_name,
    sum(nvl(t.sales_actl_amt,0)) sales_actl_amt ,
    sum(nvl(t.sales_trgt_amt,0)) sales_trgt_amt
    from inv_sales_trgt_val t,branches b,vendor v where
    t.branch_cd=b.branch_cd and
    t.vndr#=v.vndr# and
    (t.yymm between :fiscal_month and :fiscal_month2) and
    (:fiscal_month<>trunc(:fiscal_month2,-2)) and :fiscal_month2<>trunc(:fiscal_month2,-2)) and t.branch_cd between :from_branch and to_branch and
    t.vndr# between :from_vndr and :to_vndr
    group by t.vndr#,v.vndr_name,t.branch_cd,b.branch_e_name
    order by t.vndr#,t.branch_cd;
    in second query i am created two summary column and one place holder column and one formula column to get the percentage % :
    cs_3=sales_actl_amt
    cs_4=last_year_sales_actl_amt
    cp_2
    cf_1(example :cp_2=cs_3/cs_4)
    I am getting all 100 percentage.
    in the third query i created two summary column and one place holder column and one formula column to get the percentage % :
    cs_1=sales_actl_amt
    cs_2=last_year_sales_trgt_amt
    cp_1
    cf_1(example :cp_1=cs_1/cs_2)
    Here i am getting correct percentage
    I need to get cf_1 percentage but it is getting 100 for all
    its urgent please help.
    thank you.

    Create three restricted key figures.
    In one restrict month by current month.
    In other use offset of -12 and -24 while restricting current month.

  • Get last changed date by Program ID/Object type/Object name of a task

    Hi to all.
    I'm looking for a way to get last changed date of an object by task number(CR). Any SAP function or utility someone has??
    For example if I have a task with the object list:
    R3TR PROG  ZSD_ORD_COND_P
    R3TR TABL    ZCNDSLCTN
    LIMU  REPS  ZSD_ORD_COND_CLS
    R3TR TRAN   ZZDIS
    R3TR VIEW   ZSD_VBAK_KONV
    I need to get last changed date for each object.
    Thanks,
    Yuval Kaduri, Cellcom, Israel.
    Edited by: yuval kaduri on Mar 2, 2008 2:59 PM

    Hi Venu, thanks for the input.
    In the table I don't have all changes made in objects that the CR is not released. I need to know all changed date of objects even if the CR is not released. There are  few tables containing the date and time object last changed for the deferent types but I'm looking for a function or some utility someone wrote that gets the CR line info as - PgmID/Obj/Object name - and gives back last changed date and time.
    Thanks,
    Yuval Kaduri, Cellcom, Israel.

  • Odi 10 g Get Last Session Date

    Hi,
    I want to get Last run time of Package.For example I will put a filter between last run time of package and sysdate.But how can I get Last session date of a package?
    I will insert new datas to target table from last session time to current time
    Thnx a lot

    This is normal.
    You have created a variable that retrieves the ACTUAL session begin date.
    So, when you're launching your package at 11/12/2012 09:38:56, it will retrieve the begin date of this session, so 11/12/2012 09:38:56.
    If you want the previous session, you cannot use a filter like SESS_NO = <%=odiRef.getSession("SESS_NO")%>
    ==> You must filter on the previous session of the same scenario. Or the previous session of the same session name.
    Use WHERE clause to filter on finished / not running session
    But don't use <%=odiRef.getSession("SESS_NO")%>
    Other solution : use the SESS_END in order to retrieve the END date. Since your actuel scenario is not finish, you will get the last session.
    If you really want the BEGIN date of the last session, you must adapt your SQL Statement in order to get the session previously executed.

  • Not able to access data in Query

    Hi,
    I have loaded data using DTP from 2 different source systems.
    One is 3.x emulated datasource and the other is New 7.0 datasource.I have loaded data sucessfully in to DSO.Built a query on same.
    But when iam executing the query by material as selection criteria.Iam not able to found data in query from one source system.The same data is available in DSO.Please needed in this regard.

    Hi Venkat,
    After extracting data into DSO check the request whether active or not.
    Check data in DSO in contents.
    If is there any restrictions on info providers in Queries.
    Let us know status clearly.......
    Reg
    Pra

  • To get last year Net Value by fiscal period

    Dear experts,
    Since yesterday am trying to get solution where still unable to succeed.The report requirement is that they need Planned sales and actual sales qty of current fiscal year/period wise and in first column to get last year Actual sales for same period.(Ex:009.2006 to 011.2006 is input and in first coloumn 009.2005 to 011.2005)
    This is the situation:
    I have kept restricted W2 for fiscal year varient in filter and have created quantity sales(for last year) RKF with variable as "From fiscal year/period-13 and To Fiscal year/period-1"(with offset) and have placed in Key Figure structure in column section.Above this Structure have kept Fiscal year/period info object with variable "From Fiscal Year/period to To Fiscal year/period.This is because i need period wise breakup.
    I understand that above we have "From Fiscal year/period infoobject" and below that in key figure structure u have the above quoted key figure with quantity sales of previous year.I want period wise it has to show me last year(period wise) quantity with current year Planned aty and sales Qty
    Have gone through all threads and now it feels that i should to for variable exit ?...Do i have any option apart from variable exit?...If so could anybody can provide code for the same...Kindly gimme solution.
    Maximum points will be awarded..
    Thanks and Rgds
    Chandru

    Hi,
    I hope, you are entering  values 009.2006 to 011.2006 for the variable "From Fiscal Year/period to To Fiscal year/period". Am I right?
    If so, Donot restrict the fiscal year period with "From Fiscal Year/period to To Fiscal year/period like as you mentioned:--
    <i>Above this Structure have kept Fiscal year/period info object with variable "From Fiscal Year/period to To Fiscal year/period.This is because i need period wise breakup.</i>
    To get the break up Priod wise, taking Fiscal year period characterstics above  the structure is sufficient with ou any restriction.
    Under the characterstic fiscal year period take two KF (same kf called SALES QTY two times with different heading like " last year Actual sales" and "current year Actual sales ") . First KF will be restricted with customer exit varible on Fiscal year period characterstic. Second KF will be restricted with user entry varible on Fiscal year period characterstic.
    In case if you enter the value 009.2006 to 011.2006 as the iput to user entry varible, the code should generate the value 009.2005 to 011.2005 to Customer exit varible.
    With rgds,
    Anil Kumar Sharma .P
    With rgds,
    Anil Kumar Sharma. P

Maybe you are looking for

  • How to refresh a JTable of a class from another thread class?

    there is an application, in server side ,there are four classes, one is a class called face class that create an JInternalFrame and on it screen a JTable, another is a class the a thread ,which accept socket from client, when it accept the client soc

  • Firefox not working with gmail

    i tried to load gmail, but the standard view does not load, only the basic html version. whereas it loads perfectly internet explorer 9 or firefox v4. tried reinstalling, clearing cookies etc.. nothing changed. even tried "network.http.spdy.enabled"

  • HT201320 I keep getting the message that my user name or password is not correct.

    I am attempting to add a new email account to my phone.  I had the account, but it got deleted by accident.  Now I cannot get it set up because I keep getting the message that the username/password is incorrect. It is NOT.  Help

  • G-raid spindown fix?

    does it exist?

  • Using Internet and taking a phone call at the same time

    I have an Apple iPhone 5s. I generally keep the phone o/s up to date.  I recently updated to ios8 and now to ios8.2.  My problem (experienced recently), since the upgrade to ios8, I cannot take a phone call and use the Internet at the same time.  Thi