Report for previous week Sunday to Sunday

Hello experts,
If I run a report on monday and my reporting period is from sunday to sunday then will the following logic suffice
WHERE
DATE_CREATED >= TRUNC (next_day (sysdate, 'SUN')) - 14
AND DATE_CREATED < TRUNC (next_day (sysdate, 'SUN')) - 6
i.e. if I run this report coming monday on 18/05 then my report should have information from 10/05 TO 17/05.
Thnx in advance !!

If you want to check your logic try something like this:
SQL> ed
Wrote file afiedt.buf
  1  with t as (select to_date('01/01/2009','DD/MM/YYYY')+rownum-1 as dt from dual connect by rownum <= 365)
  2  -- end of test data
  3  select dt
  4        ,TRUNC (next_day (dt, 'SUN')) - 14
  5        ,TRUNC (next_day (dt, 'SUN')) - 6
  6  from t
  7* order by 1
SQL> /
DT        TRUNC(NEX TRUNC(NEX
01-JAN-09 21-DEC-08 29-DEC-08
02-JAN-09 21-DEC-08 29-DEC-08
03-JAN-09 21-DEC-08 29-DEC-08
04-JAN-09 28-DEC-08 05-JAN-09
05-JAN-09 28-DEC-08 05-JAN-09
06-JAN-09 28-DEC-08 05-JAN-09
07-JAN-09 28-DEC-08 05-JAN-09
08-JAN-09 28-DEC-08 05-JAN-09
09-JAN-09 28-DEC-08 05-JAN-09
10-JAN-09 28-DEC-08 05-JAN-09
11-JAN-09 04-JAN-09 12-JAN-09
12-JAN-09 04-JAN-09 12-JAN-09
13-JAN-09 04-JAN-09 12-JAN-09
14-JAN-09 04-JAN-09 12-JAN-09
15-JAN-09 04-JAN-09 12-JAN-09
16-JAN-09 04-JAN-09 12-JAN-09
17-JAN-09 04-JAN-09 12-JAN-09
18-JAN-09 11-JAN-09 19-JAN-09
19-JAN-09 11-JAN-09 19-JAN-09
20-JAN-09 11-JAN-09 19-JAN-09
21-JAN-09 11-JAN-09 19-JAN-09
22-JAN-09 11-JAN-09 19-JAN-09
23-JAN-09 11-JAN-09 19-JAN-09
24-JAN-09 11-JAN-09 19-JAN-09
25-JAN-09 18-JAN-09 26-JAN-09
26-JAN-09 18-JAN-09 26-JAN-09
27-JAN-09 18-JAN-09 26-JAN-09
28-JAN-09 18-JAN-09 26-JAN-09
29-JAN-09 18-JAN-09 26-JAN-09
30-JAN-09 18-JAN-09 26-JAN-09
31-JAN-09 18-JAN-09 26-JAN-09
01-FEB-09 25-JAN-09 02-FEB-09
02-FEB-09 25-JAN-09 02-FEB-09
03-FEB-09 25-JAN-09 02-FEB-09
04-FEB-09 25-JAN-09 02-FEB-09
05-FEB-09 25-JAN-09 02-FEB-09
06-FEB-09 25-JAN-09 02-FEB-09
07-FEB-09 25-JAN-09 02-FEB-09
08-FEB-09 01-FEB-09 09-FEB-09
09-FEB-09 01-FEB-09 09-FEB-09
.and check that you are getting the right "from" and "to" date for each day of the year.
;)

Similar Messages

  • Record working time: can't copy row from worklist for previous week

    When copying a row from worklist to recorded work time for previous week the following error happen.
    com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException: Access with ZERO object reference not possible., error key: RFC_ERROR_SYSTEM_FAILURE
        at com.sap.pcuigp.xssfpm.java.MessageManager.raiseException(MessageManager.java:102)
        at com.sap.xss.hr.cat.record.blc.RfcManager.rfcExecute(RfcManager.java:470)
        at com.sap.xss.hr.cat.record.blc.RfcManager.rfcCopyWorklist(RfcManager.java:378)
        at com.sap.xss.hr.cat.record.blc.wdp.InternalRfcManager.rfcCopyWorklist(InternalRfcManager.java:191)
        at com.sap.xss.hr.cat.record.blc.FcCatRecordInterface.onCopyWorklist(FcCatRecordInterface.java:616)

    If I recall correctly, the Windows clipboard system allows the developer to place different types of data in the clipboard, and convert between them. It is often possible, for example, to paste formatted text as plain text and so on. Large amounts of data are sometimes stored as "links" back to the producing program, so that it can transfer data directly.
    Now this is just a guess, but when you select all with Ctrl+A, there's a chance that Skype in fact puts all the information about the whole message into the clipboard, including its metadata such as time, sender, etc. Dragging would just select the text.
    If the receiving program cannot interpret the metadata, and the plain-text version is not also stored in the clipboard, then pasting would fail.
    Again, as I say, this is just a guess. We would have to get confirmation from the Skype developers as to whether this is true.
    Have you tried pasting into different programs? (Word, plain text editor, Powerpoint...) If one of them can accept the clipboard contents then we may get a further clue.
    EDIT: I found this program which inspects clipboard contents directly - http://www.peterbuettner.de/develop/tools/clipview/ which may also be of use.
    Sean Ellis - uses Skype chat for serious work
    Click here to read my blog post on Skype 7 and basic principles of GUI design

  • Create an Activity Report for Current Week

    I would like to create a activity report for the current week. The trick is that if the weekday is Wednesday or earlier (Sunday being the first day of the week), the report shows last week's activities; but if the weekday is Thursday or later (Saturday being the last day of the week), the report shows the current weeks activities.
    I have a filter that works in Access but does not seem to work in Siebel. It does just what I explained above:
    Between CDate(Int((IIf(Weekday(Now())<=4,Now()-(6+Weekday(Now())),Now()-(Weekday(Now())-1))))) And CDate(Int((IIf(Weekday(Now())<=4,Now()-Weekday(Now()),Now()+(7-Weekday(Now()))))))
    Thank you,
    David
    Edited by: DavidE on Oct 7, 2008 4:17 PM

    David,
    try this:
    case DAYOFWEEK(CAST(Activity."Planned Start Time" AS date))when 1 then timestampadd(sql_tsi_day,1,CAST(Activity."Planned Start Time" AS date)) when 3 then timestampadd(sql_tsi_day,-1,CAST(Activity."Planned Start Time" AS date)) when 4 then timestampadd(sql_tsi_day,-2,CAST(Activity."Planned Start Time" AS date)) when 5 then timestampadd(sql_tsi_day,-3,CAST(Activity."Planned Start Time" AS date)) when 6 then timestampadd(sql_tsi_day,-4,CAST(Activity."Planned Start Time" AS date)) when 7 then timestampadd(sql_tsi_day,-5,CAST(Activity."Planned Start Time" AS date)) else CAST(Activity."Planned Start Time" AS date) end
    This gave me the sunday of the week. You should be able to modify this format for your purposes.
    cheers
    Alex

  • Report Issue: Previous Weeks, Current Week and Next Week Values

    Hello Folks,
    this is a typical requirement...at-least typical for me..
    we have 20 weeks of data at weekly level. we have four Metrics out of which two are coming from Database and rest two are calculated metrics.
    Metric0: On Hand Qty
    Metric1: Past Qty
    Metric2: sell Qty
    Metric3: unsell qty
    Metric4: Total Qty
    the report will always be shown for 20 weeks, but depending on whats my current week, all the past weeks should be flagged as Past Week. (so i wrote a case statement for this). for Instance: I am in Week11, so my weeks in should be Past Week, Wk11, Wk12.........Wk20.
    Metric 1 is always dependent on result of Metric4 (This is the Complexity) per week basis
    Metric1 for Past weeks value in Week Column will be wk1 to wk10 On Hand Qty (fox ex: 80)
    Metric4 for Pass Weeks Value in Week Column will be Metric1 for Pastweeks + Metric2 for Past Weeks (For Ex: 20) (Past weeks mean wk1 to wk10)
    value of Metric4 is now 100
    Metric1 for Week11 Now should 100 (From Past weeks Calculation)
    Metric4 for Week11 will be Metric1 for Week11(100) + Metric2 for Week11(10) + Metric3 for Week11 (10)
    Now...Metric1 for Week12 will be 120 which is wk11 total (100+10+10) and goes on Until Week 20
    Any Ideas how to achieve this in obiee 10g
    Thanks
    Rake

    Please try out in this way....
    Database level --Create opaque view & procedure or function  to get the week total,week ago total, current week , Past week ,future week & do rpd modelling and use PIVOT VIEW.
    At answers:
    1.Here Previous week M4 is the current week M1 which means it is a cumulative value carried forward week by week.
    2. M2 & M3 are direct database columns.
    3. You have time hierarchy with WEEK Level.
    M1 - ago(rsum(m2+m3),weeklevel)
    M4- RSUM(M2+M3)
    week -AGO(RSUM(M2+M3)- M2-M3-RSUM(M2+M3)
    w1-0-10-20-30
    w2-30-11-21-62
    w3-62-12-22-96
    Now you can PIVOT IT to get in
    W1-W2-W3
    M1 0 - 30-62
    M2 10-11-12
    M3 20 -21-22
    M4 30 - 62-96
    NOW PASTWEEK (W1-W10), CURRENT WEEK(W11)-W12
    1.as you see cumulative here you need to use BINS.means ( case when week <= currentweek(maybe variable) then prior) else week)
    2. UNION - combine similar request - First cirteria week <= w11 and second criteria week > week 11 --combine pivot it. Use sum agg in fx criteria1.
    Hope this should solve your pblm at answers.
    Edited by: MK on Oct 27, 2011 12:48 PM

  • Report for monthly/ weekly stock analysis

    Hi,
    Could anybody please let me know the transaction code for the following.
    -> I would like to call a report for stock analysis (quantity basis not stock value), What I want is to call up figures of monthly / weekly usage over 6 months.
    Thanks in advance

    Hi ,
    Pls try MC45.
    Enter only one object to analyse either : plant/ pur org/sales org
    Input your period to analyse
    Report shows  consumed materials with stock value and qty ..Click double line & triple line tabs to get more details.
    thnks
    nandu

  • Inventory report for Previous Periods

    Hi Experts ,
    I would like to have an inventory report for all materials in a Particular Plant for the Periods Sep 2009 and Sep 2010 . Could you please help me in providing the reports for the same .
    Thanks
    Moderator message: Basic frequently asked question - Please search forum for answers and read the docu in help.sap.com 
    See as well our rules of engagement: http://scn.sap.com/docs/DOC-18590
    A good way to search the forum is with google. See this blog with details for a good search
    http://scn.sap.com/community/support/blog/2012/04/16/getting-the-most-out-of-google-optimizing-your-search-queries
    This blog describes how to use the SCN search: http://scn.sap.com/community/about/blog/2012/12/04/how-to-use-scn-search
    The discussions are not a replacement for proper training
    Thread locked
    Message was edited by: Jürgen L

    You can well run these reports on background..
    Go to SE38 Enter the program name "J_1HSTCD"
    Then press Execute / F8.
    Enter you selection date as 01.09.2009 to 31.09.2010 and enter the plant and leave the all selection as per SAP standard..
    Then press F9 or Go to Program

  • How to show a report for 'Previous Month' Data

    Hi Gurus,
    I have a requirement, where i have to default my report to show previous month data.
    Scenario:
    My prompts by Default are set to CURRENT (current year,quarter,month). once the user logs in, the report should display data for month 'Nov' instead of 'Dec'.
    I tried using TIMESTAMPADD() in the formula , but it didn't work, though i don't see any error. Not sure if i 'm missing something.
    Is there a way to achieve this.I 'm using OBIEE 11.1.1.6.
    Any help is highly Appreciated ! Please.
    Thanks,
    Ramya

    From what you wrote I am assuming the user can manually save the report results to the Excel file.
    If your report uses ALV Grid it is possible to export the data to a spreadsheet (one of the functions available in the ALV tool bar).
    If you have used WRITE statements it is also possible to save the output as a spreadsheet (menu System -> List -> Save), but the latter will not produce as nice a spreadsheet if the data don't form a matrix. In other words, some work may be necessary in the spreadsheet afterwards before it has the format your user wants.

  • HP Officejet G85 - how do i print a fax report for previous month?

    When I select "Print Fax Report" from menu, prints only last 30 faxes. Can I print fax report of a longer period, such as the previous month?

    Hi there,
    Unfortunately I do not see any options availble like that for the G85. There does not seem to be a readily available option sorry.
    Best of Luck!
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Bi 7.0 SD report for previous year, month, current month, rolling 30days.

    I have Sales document type in rows and in column, I have no of sales documents.
    Now, I need sales documents in rows and no of sales documents in columns according to
    created on date: 0calday of types as follows
    List of columns:
    Previous year    last quarter   Current quarter     Current month    30 days rolling.
    How do I define these RKFs.. do we have standard date variables for RKF.
    Thanks
    Jeff

    Hi ,
    You dont have a standard date variable
    I have the solution for ur problem
    here u can go for creation of variable for column KF and assign the value for each sales document type = 1 by using a customer exit
    Pls assign some points if answer is helpfull
    Regards ,
    Subash Balakrishnan

  • Strange web traffic behaviour for previous week

    Hi,
    I have been experiencing strange web behaviour with my infinity 2 connection for approximately the last week. I say "web" because the connection speed for other applications is fairly rapid still, but general web browsing is very laggy.
    I'm using mainly Apple kit. Time capsule plugged into infinity box. Two iPhones, two Macbook Airs and an ipad. Using a mixture of wired and wireless connections. All show the same issue for websites, where as pages will either take a while to load or half load and not respond until tried upon a second attempt.
    Looking at network traffic it would look like what happens is occasionally some HTTP requests hang and eventually time out. I've tried VPN'ing out then web browsing via the VPN and it doesn't experience the same issue.
    Anyone have any ideas or experienced similar? Sounds like some kind of BT traffic shaping or transparent proxy perhaps? 
    Thanks in advance...

    I’ve done some analysis to try find out what is happening and come to conclusion there is definitely some packet loss going on which appears to be the cause of the problem. I’m not sure if this is the correct forum for this level of technicality but hopefully someone at BT will see this and act on it.
    In the instances where the request fails, it is almost certainly because the TCP three way handshake does not complete. Specifically this is final ACK packet back from the client to the server is lost en route but strangely no ICMP error messages which you’d expect to see.
    In the example log below a request to an asset on the BBC news website failed. Somewhere within BT, the final ACK to establish the connection is being lost; so the connection is in a kind of limbo state where it is trying to ask for a particular page asset but the remote server still thinks there’s an ACK packet to come. This is what is causing the actual ‘hang’ within the browser since it is waiting for data to be returned which never is.
    21:19:27.626789 IP 10.0.1.2.56024 > 109.144.113.190.http: Flags [S], seq 303285671, win 65535, options [mss 1460,nop,wscale 4,nop,nop,TS val 197730955 ecr 0,sackOK,eol], length 0
    21:19:27.639592 IP 109.144.113.190.http > 10.0.1.2.56024: Flags [S.], seq 2613461067, ack 303285672, win 14480, options [mss 1400,sackOK,TS val 236085456 ecr 197730955,nop,wscale 1], length 0
    21:19:27.639667 IP 10.0.1.2.56024 > 109.144.113.190.http: Flags [.], ack 1, win 8241, options [nop,nop,TS val 197730967 ecr 236085456], length 0
    21:19:27.641567 IP 10.0.1.2.56024 > 109.144.113.190.http: Flags [P.], seq 1:368, ack 1, win 8241, options [nop,nop,TS val 197730968 ecr 236085456], length 367
    21:19:27.718538 IP 109.144.113.190.http > 10.0.1.2.56024: Flags [S.], seq 2613461067, ack 303285672, win 14480, options [mss 1400,sackOK,TS val 236085535 ecr 197730955,nop,wscale 1], length 0
    21:19:27.718617 IP 10.0.1.2.56024 > 109.144.113.190.http: Flags [.], ack 1, win 8241, options [nop,nop,TS val 197731040 ecr 236085535], length 0
    21:19:27.968834 IP 10.0.1.2.56024 > 109.144.113.190.http: Flags [P.], seq 1:368, ack 1, win 8241, options [nop,nop,TS val 197731286 ecr 236085535], length 367
    21:19:28.271157 IP 10.0.1.2.56024 > 109.144.113.190.http: Flags [P.], seq 1:368, ack 1, win 8241, options [nop,nop,TS val 197731588 ecr 236085535], length 367
    21:19:28.673944 IP 10.0.1.2.56024 > 109.144.113.190.http: Flags [P.], seq 1:368, ack 1, win 8241, options [nop,nop,TS val 197731990 ecr 236085535], length 367
    So with this in mind, I’m open to as whether it is just web. It’s likely that it could be other protocols as well. It could be that web is more susceptible due to the number of separate connections that need to happen for each page view.

  • Previous week Dates

    Hi all
    Please help in writing a query to get the previous week data.
    If the input date is sysdate then it should return values for previous week Monday to Sunday.
    Whatever the input it should get the value for previous week from Monday to Sunday.
    Thanks
    Jo

    IW is the formatter for the "Iso-Week"
    ISO = international standard organization
    See also: http://en.wikipedia.org/wiki/ISO_week
    Main thing is that it will always start with monday. The weeknumber might be different then for ww format. This doesn't matter in your case. But you migh want to do some experiments with to_char(sysdate,'IW'), to_char(sysdate,'WW').
    Trunc(<datevale>,'IW') will cut the date back to the first day of this iso-week.
    select to_char(sysdate-365,'IW') IW , to_char(sysdate-365,'WW') WW from dual;
    IW     WW
    37     36Edited by: Sven W. on Sep 9, 2010 2:29 PM

  • Vendor evaluation report to be run for previous period

    Hi,
    Is the possible to run the Vendor evaluation report for back date.
    i.e. if the period of evaluation is 30 days, can we run the report for previous periods
    Regds,
    Ritesh

    Depending on the library you are using, can you verify whether you can use one of the following variables?
    1PERIK   
    1PERW   
    5ACPERI  
    6-PERIK  
    8WPERIO
    All these variables use fiscal periods and not calendar periods, that way you don't have to bother about number of weeks in a period, unless you really need to do the calculation based on number of days in a period.
    If your library does not support these variables, then pl copy one of these variables (GS11) with appropriate details into a custom variable and use it in your report.
    Let me know.
    Regards
    Subodh

  • Selection variable with default value as previous weeks mon through sun

    Hi Experts,
    1.)
    I need to create a Selection Variable ZTRANS_DT ( type Interval ), with the default value as  "Previous week, Monday Through Sunday" .
    Should we have to write a customer exit to populate these interval values dynamically every time the user runs the report ?
    If so can you please write a sample ABAP code.
    2.)
    The filter restriction for the date feild ZBUSINSDT has to be set to ">=#1/1/CURRENT YEAR#" ..
    How to set current year dynamically.
    Help done would be appreciated and would be assigned points.
    Thanks,
    Santosh..

    Hello,
    I dont remember of any standard variable but still you can wait to see if any1 comes up with one.
    Or else you can try the foll:
    Create the variable as per your requirement.
    Then in CMOD, write a simple code for i_step = 1.
    logic can be l_t_range-low = sy-datum - 1.
    Regards,
    Shashank

  • Getting previous weeks data based on parameters entered

    I am using CRXI. I have a RT that gives me the current week data but I need to be able to report on previous week data based on the paraments so if I enter dates between sunday and saturday of one week it will report on those data plus the same days of the previous week. I looked at the lastfullweek function, but not sure how to implement it in my scenerio. any ideas?
    Ralph

    That worked, thankyou. My next question along the same lines, is I am also having a third column that will indicate the percent change. for example
    Current             Previous              % Change
    97                    108
    I am trying to computer the % change between curent and previous basically it would look at previous as being the control and computer positive or negative based on what current is. I can do the math formulas, but I'm not sure what to comute to find the % change.
    Ralph

  • Reports for Low disk space alerts in scom 2007

    Dear Experts,
    Is there any possible to get the Low disk Space alerts reports in SCOM 2007 R2.
    1, I need reports for Last week SCOM sent alerts on Low Disk space for the servers list
    2, Likewise I need SCOM Low disk space alerts reports for last month.
    Can somebody please explain me with the steps and I played much with Reporting pane.
    Thanks,
    Saravana

    Hi,
    The below code should work to get all servers that have alert of logical disk free space is low in specific period:
    get-alert -criteria 'Name = ''Logical Disk Free Space is low'' AND TimeRaised >=''3/24/2014'' AND TimeRaised <= ''4/24/2014''' | select MonitoringObjectDisplayName,MonitoringObjectPath,Name,TimeRaised | sort MonitoringObjectDisplayName
    Here is a similar thread for your reference:
    how to create a report showing the servers that had the alerts of "Logical Disk Free Space is low" for a specific period?
    http://social.technet.microsoft.com/Forums/en-US/50f2c3fb-2dfc-47c6-8c2a-8a2f0149df10/how-to-create-a-report-showing-the-servers-that-had-the-alerts-of-logical-disk-free-space-is-low?forum=operationsmanagerreporting
    Regards,
    Yan Li
    Regards, Yan Li

Maybe you are looking for