Calculate sales for last 60 days

hello
want to make key figure or formula, which calculate sales for last 60 days, but also i need to add week group in report, so for each week i need sum sales for last 60 days before this ...
is any solution to that?
thank you.

Alex,
I'm not very clear on what you are asking.
If you use your time parameters in selections you can use caldays and weeks with your key figures.
ie. Selection 1 has your key figure and calday restricted t the last 60 days.
Selection 2 has your key figure and Fiscal Week but I am not clear on the range required for fiscal week.
Regards
Gill

Similar Messages

  • How to get YTD sale for Last year In OBIEE 11g

    Hi All,
    I have a fact table for Sale_Amt with doc_date wise details. It is connected to Simple time_dimension table based on Date_ID(Number) field. The time_DIm Hierarchy is set on Year, Quarter, Month fields of the time_dimension table.
    One of my reporting requirement is to show show YTD sales and Last Years YTD sales.
    e.g, If user select 23 Jul 2013 as the date parameter, I need to show 1-Apr-2013 till 23 Jul 2013 Sales in YTD column and 1-Apr-2012 till 23 Jul 2012 Sales in Year_Ago_YTD column. I am able to get YTD sales but unable to derive at Year_Ago_YTD sales figures.
    Finacial Year Start from 1st April till 31 March.
    Any Help on this will be appriciated.
    Thanks.
    Narendra Shetty.

    Narendra,
        You can make use of the below two functions to get the year ago dates. You can replace current_date with a presentation variable that stores the date parameter that user selected.
    TimestampAdd(SQL_TSI_YEAR,-1,TIMESTAMPADD(SQL_TSI_MONTH, 3,TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) - It will display previous year's first day of fiscal year (since I passed current_date, it gives you 1st april 2012)
    and
    TimestampAdd(SQL_TSI_YEAR,-1,current_date) - Same Day Last year
    Pls mark correct/helpful.

  • UDF for last day of week/month

    Input is a Date(For example: 2010/03/12) in String  format.
    I need to extract the last day of that week and return it as a string output.
    For example if input is 2010/03/12 and thatu2019s a Thursday my output should be 2010/03/14 i.e Saturdayu2019s date.
    Similarly I need to extract last day of month too.
    Thanks in advance
    Soumen...

    Hi,
    I did not develop this one... but just use "search" button on roseindia and you will have the answer (I think):
    [http://www.roseindia.net/java/beginners/DayOfYearToDayOfWeek.shtml|http://www.roseindia.net/java/beginners/DayOfYearToDayOfWeek.shtml]
    and do not forget that Google is your friend...
    do a research with : Java last day of week, and you have plenty of examples.
    Thanks.
    P.S: Say us when you will solved your problem.

  • Variable for last day of last month....

    Hi,
    Can somebody let me know the code to find the last day of last month from the query variable.
    Is there any standard/business content  variable available for this?
    I have found one similar variable , but its for the posting date.
    Any help is appreciated.
    Regards...

    Check this code:
    l_date_from = sy-datum.
           l_date_from+6(2) = '01'.
           l_date_from = l_date_from - 1.
           l_s_range-sign = 'I'.
           l_s_range-opt  = 'EQ'.
           l_s_range-low = l_date_from.
           l_s_range-high = space.
           APPEND l_s_range TO e_t_range.
    You can modify based on your specific requirement.
    Regards,
    Kams

  • Calculate Dates for Last week and next three weeks

    Hi,
    I have a report where I need to calculate dates between last week and the next three weeks (not counting current week). I'm familar with the first part, it could be done by using the LastFullweek function but not sure how I can avoid the current week and calculate the next three weeks.
    Any help is greatly appreciated.
    Thanks!

    ... and here are a few more...
    Last Week...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate), #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -1, #1/7/1900#)
    THEN TRUE ELSE FALSE
    The week before...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -1, #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -2, #1/7/1900#)
    THEN TRUE ELSE FALSE
    And the week before that...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -2, #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -3, #1/7/1900#)
    THEN TRUE ELSE FALSE
    and of course all 3 weeks together...
    IF {TableName.Date} IN
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate), #1/7/1900#)
    To
    DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -3, #1/7/1900#)
    THEN TRUE ELSE FALSE
    If you want the 1st day of the week to be Monday instead of Sunday just change the date of #1/7/190# to #1/1/1900#
    HTH,
    Jason

  • Dynamic Variable for last day of month

    Hi all,
    I have created one report where in YTD is calculated based on stsyem date. NOw in this report the cal month is in row thus displaying data month wise. But i need one key figure which giving the last day vaue of every month that are displayed in YTD i.e this is based on cal day. Thus the report layout is as follows:
    if report is run in mar 2007 then it should display:
    calmonth            key figure due amount
    Jan 07                this should show due value on last day of jan 07 (i.e 31st jan 07)
    Feb 07               this should show due value on last day of feb 07 (i.e 28th feb 07)
    Mar 07               this should show due value on last day of mar 07(i.e 31st mar 07)
    customer exit variable can give me only one value at a time. How can I make it dynamic to take last day value of every month as per cal month. Could anybody explain me if worked on any such issue.
    If there is some how to paper kindly mail me at my email Id : [email protected]
    thanks in advance
    Regards,
    Wrushali

    Hi,
    We can assign multiple single values to the customer exit.
    So in the Query take CALMONTH in rows.
    And take your KF in column with Customer exit variable restriction on CALDAY.
    So in the code of this Cusotmer exit varible, from the Current date find out the year of the current date and then assign those 12 required days to this variable.
    With rgds,
    Anil Kumar Sharma .P

  • Select statement for last day of the last quarter and first quarter

    Anybody provide me the single select statement which should result the last day of the last quarter and last day of current quarter?
    Ex: Select last date of the last quarter,last day of current quarter from XYZ(DUAL...)
    Thanks in Advance

    Hi,
    Here's one way:
    SELECT               TRUNC (SYSDATE, 'Q') - 1     AS prev_qtr_end
    ,     ADD_MONTHS ( TRUNC (SYSDATE, 'Q') - 1
                 , 3       
                 )                    AS this_qtr_end
    FROM    dual;TRUNC (dt, 'Q') returns the first day of the quarter containing dt.
    Subtract one day from that, and you have the last day of the previous quarter.
    Add 3 months to that, and you have the last day of the current quarter. ADD_MONTHS (dt, n) will always return the last day of a month if its first argument, dt, is the last day of a month.

  • No change to financial summary or a single sale for 2 days

    Can the above be correct. Downloads are showing but have never gone 2 days without a single sale before?
    Malcolm Bain
    Malcolm Bain

    Hello Malcnoo,
    If you are still experiencing this issue please contact Dev Center Support for assistance.
    -Miles
    Windows and Windows Phone Dev Center Support
    Send us your feedback about the Windows Platform

  • Average for last 7 days

    I am trying to calculate Deviation Measure for the Reports and the formula to calculate is –
    (average(last 7 days count ) – today’s count/100 )*10
    Problem here is to calculate average for last 7 days .
    I am using moving average but if I apply a filter , Moving average is calculated for the number of rows displayed whereas I want it for the number of days.
    Formula for Moving average is - MAVG(Row Count,n) where n is number of rows displayed and not number of days. Is there any possible way to do it.

    (average(last 7 days count ) – today’s count/100 )*10
    Filter( avg(col1) using date > current_date-7)) --Average for last 7 days
    Filter(count(col) using date = current_date) - today's value

  • Sales of Last two days of each week in a given Posting Period ???

    Hi,
    Here I would like to share one of my tech. requirement in Bex query, your inputs are much appreciated -
    Scenario - In report I want to show "Sales for Last two days of week". I elaborate more like -
    (1) User inputs will be given for "Fiscal period" through Variable.
    (2) In Row all weeks lying in this period will be displayed.
    (3) In Column 1, Sale for each week will be shown.
    (4) In Column 2, Sale for Last two days of each week is to be displayed. (here we need to restrict Sales with last 2 Calendar days of each week.)
    Point 4 is of my concern. Any suggestions will help a lot. Points must be assigned.
    Regards,
    Saurabh

    Hi,
    I do not have a very good solution for you - see if this is of use.
    Firstly, I am not sure if it is possible to show the query like you want, with the weekly sales and the "last 2 day/week" sales combined and intertwined in one query.
    To create a query which will only show the sales of last 2 days of every week, what you can do is to create a variable on 0calday which will be 'multiple single values' type and will be calculated based on the user input of fiscal period (exit variable). This exit logic should assign the variable the last 2 days of each week falling within this period.
    Now you can put 'week' in the in the rows and restrict the query filter using the 0calday variable; put the KF in the columns area. This would lead to one row being displayed for each week and sales for only the last 2 days showing in that row.
    Creating a query for weekly sales is simple - maybe then you can put these two queries side by side in a workbook/web template.

  • Find the first and last day of week giving a certain date

    Hi,
    i have an application in wich the user puts a date, say today 2010-08-10 and i have to calculate first and last day of that week, in this case 2010-08-09 and 2010-08-15. How can i do this?
    Many thanks in advance,
    Nuno Almeida

    nfalmeida wrote:
    i have an application in wich the user puts a date, say today 2010-08-10 and i have to calculate first and last day of that week, in this case 2010-08-09 and 2010-08-15. How can i do this?First step is being sure that you know what a 'week' is.
    For example does it really start on monday? And will it always start on monday?
    And what day does the 'week' end on for 2010-12-29? In some businesses it will end on 2010-12-31 (friday)

  • Printing Last Day of previous month

    I need to print Last day of previous month, and the date value is relative to the system date.
    In my previous post i have got the answer to print last day of current month. To print last date in previous month do i need to use RelativeDate? and I am not sure whether I can use RelativeDate for months.
    Raghu

    Right now I have written below formula, and it works fine in all cases like if the current month equals to 01, 03, 05,07,08,10 and 12 and months other than mentioned in above including 02.
    for First day of previous month
    =If (FormatDate(CurrentDate();"MM"))InList("07";"08";"10";"12";"05";"01";"03") Then
    (If(FormatDate(CurrentDate();"dd"))="01" Then
    FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-1));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-1)));"####")Else
    FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-31));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-31)));"####"))Else
    FormatDate(LastDayOfMonth(RelativeDate(CurrentDate();-30));"MM")"/01/"FormatNumber(Year(LastDayOfMonth(RelativeDate(CurrentDate();-30)));"####")
    For Last day of previous month
    =If (FormatDate(CurrentDate();"MM"))InList("07";"08";"10";"12";"05";"03";"01") Then
    (If(FormatDate(CurrentDate();"dd"))="01" Then LastDayOfMonth(RelativeDate(CurrentDate();-1))Else
    LastDayOfMonth(RelativeDate(CurrentDate();-31)))Else LastDayOfMonth(RelativeDate(CurrentDate();-30))
    Please let me know any other suggestions.
    -Raghu

  • Formula to calculate the last day of the subsequent month

    Hi - I am trying to create a formula in CR9 that will take a date field and translate it to the last day of the subsequent month.  For example, I have a date of today, 2/3/2009.  I need it to print on the report 3/31/2009.  I have made some progress to get me the 1st day of the subsequent month, but I need it to be the last day of the subsequent month.
    The formula I am have currently is:
    DateSerial(Year({Name.JOIN_DATE}), Month({Name.JOIN_DATE}) + 1, 0)+1
    this will give me 3/1/2009, but I need 3/31/2009.
    Any help appreciated. 
    Thanks!

    Hi Joe,
    You can use the following logic which also takes into account the extra day in a leap year.  You will need 5 formulas for this:
    First create a formula that calculates current month, call it @Current Month MM
    Month(Name.JOIN_DATE)+1
    Next create another formula called @Current Month Start Date which will give you the beginning of the month.
    totext(Date (year(currentdate),tonumber({@Current Month MM}) ,1 ))
    Next create another formula called @Current Year yyyy
    Year(Name.JOIN_DATE)
    Next, create a formula called @DaysofMonth with the following logic:
    if tonumber({@Current Year yyyy}) mod 4 = 0 then
    choose(month(date({@Current Month Start Date})),31,29,31,30,31,30,31,31,30,31,30,31) else
    choose(month(date({@Current Month Start Date})),31,28,31,30,31,30,31,31,30,31,30,31)
    Lastly create a formula called @Ending Date of Month
    totext(Date (year(currentdate),tonumber({@Current Month MM}) ,{@DaysOfMonth} ))
    I hope this information proves useful.
    Regards,
    Zack H.
    Edited by: Zack H on Feb 3, 2009 5:34 PM
    Edited by: Zack H on Feb 3, 2009 5:38 PM

  • Query for last 8 days results

    any body have a query for last 8 days results
    TIMESTAMPADD(SQL_TSI_DAY, -8, CURRENT_DATE) this is resulting only 1 day results only .if i execute this query is it displaying 8th back day results only.
    i want all 8 back days results .
    anybody have query for this...
    Edited by: user12255470 on Apr 28, 2010 7:19 AM

    This works fine for me:
    SELECT "D0 Time"."T00 Calendar Date" saw_0, "F1 Revenue"."1-01 Revenue (Sum All)" saw_1 FROM "Sample Sales" WHERE "D0 Time"."T00 Calendar Date" BETWEEN TIMESTAMPADD(SQL_TSI_DAY, -8, CURRENT_DATE) AND TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE) ORDER BY saw_0
    regards
    John
    http://www.obiee101.blogspot.com/

  • Customer exit variable for date range for the last day

    Hi,
    If user enters date ranges in variable
    suppose user enters 9/1/2010 to 9/15/2010 and we have to calculate currency conversion based on last day i..e 9/15/2010 . 08
    2)User input is date range 08/01/2010 to 08/30/2010
    I need from the customer exit 08/30/2010 (on last day) to calculate currency conversion.
    Can anyone help me with ABAP code to achieve this customer exit?And please tell me how to proceed step by step
    Sridhar

    create a variable to enter date range (ZDATE1)
    create a key date variable(ZDATE2) with processing type customer exit, should not be ready for input.
    In the exit ZXRSRU01 write below code.
    DATA: l_s_range TYPE rsr_s_rangesid,
          loc_var_range LIKE rrrangeexit.
    WHEN 'ZDATE2'.
        IF i_step = 2.
           read table i_t_var_range INTO loc_var_range
                    with key vnam = 'ZDATE1'.
            CLEAR l_s_range.
            l_s_range-low = loc_var_range-high.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            APPEND l_s_range TO e_t_range.
        ENDIF.

Maybe you are looking for

  • HD needs to be repaired, Time machine is failing

    My mac os x 10.5.8 has been acting very wierd.  The other days after restarting it, it would not go past the apple/grey screen.  Then i retried while holding (i believe commn, alt, p &R) and it worked.  Howevere, my mac has been acting very badly/fre

  • Configure EP6 SP11 for SSL

    I am following the instructions (help.sap.com) for applying SSL but they are slightly confusing. 1. You apply the SSL to J2EE 2. You have to have the Key Storage Server running - but how do you ensure that it is? Is it by default when the J2EE is run

  • Local Director & HTTP Redirection

    Hi, just wondering if anyone has successfully implemented HTTP redirection on Cisco Local Director 416 running ver 4.1.2 Basically I'm after any pitfalls to look out for. Current implementation utilizes generic session stickiness however this has pro

  • Installation and system preferences

    everytime i install something nothing happens, some word document pops up and its blank, and im talking about installing things like...safari or quicktime, i install them and i get a blank icon and it cant find an application or its a word document.

  • OBIEE ON WINDOWS 7

    Hi, Does OBIEE 10g work well on windows 7.I mean does it give any issues of any sort .If any one has tried it full fledged on WINDOWS 7. Edited by: ashwini on Apr 12, 2011 1:32 PM