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

Similar Messages

  • How to get data for current week and previous week using customer exit in Bex.

    Hi everyone,
    I have a scenario in which I need to display data for current week and previous week (based on "sy_datum" the program has to calculate current week and previous week) in Bex using  Customer exit. I have created one variable in Bex Query Designer and I have written code for the variable in CMOD. But it is not working fine, (I know that we can do the same by using offset value in Bex). Can some one guide me how to achieve my requirement using customer exit.
    Thanks in Advance,
    G S Ramanjaneyulu.

    Hi krishna,
    Thanks for your quick reply, can you have a look at my code,
    case i_vnam.
    WHEN 'ZPWK_CWK'.
    ranges : pre_week for sy-datum.
    data : start_date type DATS,
           end_date TYPE dats .
    ************FM TO GET FIRST DATE OF CURRENT WEEK ************************
    CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
      EXPORTING
        DATE_IN  = sy-datum
      IMPORTING
        DATE_OUT = start_date.   " WEEK FIRST DATE
    end_date = START_DATE + 6.   " WEEK LAST DATE
    END_DATE   = START_DATE - 1.   " PREVIOUS WEEK END DATE
    START_DATE = START_DATE - 7.   " PREVIOUS WEEK START  DATE
    **********PREVIOUS WEEK DATES IN PRE_WEEK******************
    pre_week-SIGN   = 'I'.
    pre_week-option = 'BT'.
    pre_week-LOW    = START_DATE.
    pre_week-HIGH   = END_DATE.
    APPEND  pre_week.
    CLEAR : START_DATE,END_DATE.
    endcase.
    Regards,
    G S Ramanjaneyulu.

  • How to create a daily report for sales order

    hi
    how to create a daily report for sales order. what fields it must consists of. what are the tables it need?

    Hi
    You have to use the sales order tables VBAK,VBAP and VBEP
    So keep date field on selection screen
    and treat this date as Order creation data audat field in VBAK.
    based on this fetch the data from VBAK and VBAP  with the following fields like
    VBELN, KUNNR,NETWR,POSNR, MATNR,ARKTX,KWMENG,WAERS  etc and display in the report
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Sales report for current month and year a go month

    i could you please guide me builting report for current monthwise for current month and year a ago month
    report parameter month_year='06-2010'
    tables = sales and below are the table fields
    customer_id
    invoice_dt
    invoice_am
    thanks
    nhm

    Okay, Still you did not mention how you will pass value in report while generating.
    Anyway the query with UNION ALL will work. For Example.
    I am assuming that the parameter for date/month you will pass in range like 01-JUN-2010 to 30-JUN-2010
    SELECT customer_id, SUM(curr_value) curr_value, SUM(past_value) past_value
    FROM
    SELECT customer_id, NVL(SUM(invoice_amount),0) curr_value, 0 past_value
    FROM sales
    WHERE invoice_dt BETWEEN :P_FROM_DATE AND :P_TO_DATE  -- here P_FROM_DATE and P_TO_DATE will be the date range for current year as i showed above.
    AND  -- Any Condition goes here...
    GROUP BY customer_id
    UNION ALL
    SELECT customer_id, 0, NVL(SUM(invoice_amount),0)
    FROM sales
    WHERE invoice_dt BETWEEN ADD_MONTHS(:P_FROM_DATE,-12) AND ADD_MONTHS(:P_TO_DATE,-12) -- This add_months function for the previous year same month.
    AND -- Any condition goes here...
    GROUP BY customer_id
    GROUP BY customer_idNow using the above query you can design the tabular report as you showed the format.
    -Ammad
    Edited by: Ammad Ahmed on Jul 3, 2010 7:55 PM
    added GROUP BY

  • Creating a Crystal Report for B1 without parameters

    Hi Experts,
    My question is a simple one.
    I create a crystal report for SAP B1 8.8 Patch 10 using CR 2008 SP02.
    I have no parameters since its showing sales figures of the past month.
    But when I run the report in SAP, a selection criteria screen pops up without any fields.
    Just OK and Cancel.
    I dont want my users to have to click OK. I need the report to pop-up once the user click on the SAP Menu for the report.
    My report file has no parameters.
    Thanks for the help
    Denis

    Deinis,
    In your report, do you mean:
    - you have parameter created, but not used in the report? OR
    - there is no parameter field in the report at all?
    The reason I am asking is:
    If you have parameter fields, But, you did not use it in the report, I think when you run the report within SAP B1, it will still prompts for user to enter something.
    Also, if you are using subreport, make sure there is no parameter in the subreport, Although you do not use them.  Just delete the parameter field from the list if you are not using them.
    Edited by: Shwu Hua Gan on Jun 20, 2010 2:59 AM

  • Where do I start in order to create a summary report for a questionnaire?

    I am creating a summary report for an internal questionnaire took by branches of a company.
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    The two tables in use are:
    SQL> describe answers;
    Name Null? Type
    ID NOT NULL NUMBER(38)
    QUESTION_ID NOT NULL NUMBER(38)
    LABEL NOT NULL VARCHAR2(150)
    The 'answers' table contains the answers for each question.
    SQL> describe user_answer;
    Name Null? Type
    ID NOT NULL NUMBER(38)
    USER_ID NOT NULL NUMBER(38)
    ANSWER_ID NUMBER(38)
    ANSWERED_QUESTION_ID NUMBER(38)
    DATE_ANSWERED DATE
    The 'user_answer' table contains the selected answer(s), from the 'answers' table, by the user.
    There are 150 questions total in the questionnaire made up of either single or mulitple choice questions. As a sample, the first three questions look similar to:
    Q.1 Do you use BIS or BES? Yes[] No[]
    Q.2 What is your favorite phone shell colors? Green{} Red{} Black{} Silver{}
    Q.3 Do you plan to purchase a new phone today? Yes{} No{} Unknown{}
    I need to find the total for each possible answer for all the users. For example, I have four individuals who take the questionnaire.
    Alpha answers the first three questions as:
    Q.1 - Yes
    Q.2 - Green, Red
    Q.3 - Unknown
    Bravo answers the first three questions as:
    Q.1 - Yes
    Q.2 - Green, Red, Black
    Q.3 - Yes
    Charlie answers the first three questions as:
    Q.1 - No
    Q.2 - Green, Black
    Q.3 - No
    Delta answers the first three questions as:
    Q.1 - No
    Q.2 - Green, Red
    Q.3 - No
    Using the two tables above, I need to produce the following summary.
    Q.1 Yes - 2, No - 2
    Q.2 Green - 4, Red - 3, Black - 2, Silver - 0
    Q.3 Yes - 1, No - 2, Unknown - 1
    Reading through chapter 9 SQL Queries and Subqueries at http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries.htm#i2068094, I'm not for sure if this is the right place to start? I'm testing with the GROUP BY and ORDER BY statements with not a lot of luck here either.
    Any suggestions on how to get started or possible examples would be greatly appreciated.
    Thank you.

    Thank you.
    I will be sure to include the CREATE TABLE and INSERT statements in the future.
    Your example is appreciated and I've came up with the following solution for the report:
    WITH summary_results
              AS ( SELECT     answered_question_id, answer_id, COUNT ( * ) AS cnt
                             FROM     user_answer
                        WHERE          user_id = 43798
                                       OR user_id = 2371
                                       OR user_id = 1731
                                       OR user_id = 19935
                   GROUP BY     answered_question_id, answer_id
                   ORDER BY     answered_question_id, cnt DESC)
    SELECT     sr.answered_question_id, sr.answer_id, sr.cnt, a.label
    FROM     summary_results sr, answers a
    WHERE     sr.answer_id = a.id;

  • Activity Report for Collaboration Rooms

    Hi,
    Is there some kind of Activity Report only for Collaboration Rooms ? Like we have Portal Activity Report for entire portal.
    Please give me your suggestion. Helpful answer are appriciated.
    Regards
    Prakash T

    Hi Prakash,
    You can run the room usage analysis to check how often particular rooms have been used in a specific period. Please check out the following page on help.sap.com:
    http://help.sap.com/saphelp_nw70/helpdata/EN/44/512abdba4b1193e10000000a155369/frameset.htm
    You might also have a look at the Room Inventory List which is linked on the page mentioned above.
    kind regards,
    Ursula

  • Portal Activity Reports for multiple groups

    Hi,
    Can the report display the count of users belonging to multiple groups or would it have to be created seperately for each group. I have tried to use wild cards and commas and nothing worked, the field does not accept more than one valid group name to be entered. Any ideas how to work around this without having to create a different report for different groups?
    Thanks

    Hi EAmin,
    You can only show information about users who belong to a specific group and not multiple groups. But if you want to show users in multiple groups, you can create a new group (say temp) and add the other groups to temp. Now, configure the report to display users in group temp.
    Rajiv

  • When we create any EVDRE report for any application getting an error

    Hi Experts,
    When we create any EVDRE report for any application getting an error                                                                               
    EVDRE encountered an error retrieving data from the web server.. We also                                                             
    tried creating EVDRE report on the APP SET/RATE application still getting the same error. All the cell base reporting are working. We are on the latest patch. the server and the client machine. 
    1) BPC Version : 7.0 MS (7.0.115.06)                                                                               
    2) SQ L Server 2005 SP3                                                                               
    3) Office 2007 with latest support packs                                                                               
    4) It is happening since the install                                                                               
    5) All users are getting the same error. Tried from two different PCs,                                                             
    same issue. also tried the Install (ADM id) and also the ids created. All                                                          
    ids are having this issue.                                                                               
    6) Single Server environment.      
    Please send reply as soon as possible.
    Regards,
    Arjun.

    Hi,
    There are many many SAP notes existing on the same subject.
    I would recommend you to go through them. You will potentially find the solution for your problem.
    Some examples of SAP notes: 1242648, 1395993, 1453433, 1439155, 1439100.
    Hope this will help.
    Best Regards,
    Patrick

  • How to Keep the spool created of a report for one month

    Hi ,
    How do we program to keep the spool created of a report for 1 month?
    I used SUBMIT TO SAP-SPOOL but it seems that its maximum retention is only 9 days...
    Please advice.
    Thanks!

    This would be a question for your basis administrator.
    Rob

  • How run the run the BI Publisher report for current/active/selected record

    Hi,
    I have one requirement to generate a BI Publisher report in Siebel, which will run on SR's List view. Report should fetch the active SR and its audit trial entities. I know this was achieved easily using Actuate (simply setting "current Recrod only" to true), but I need how to achieve this in BI publisher.
    This report we are creating is in Siebel-BI Publisher integrated environment, not connecting to database. Can body give share your valuble inputs.
    Thanks,
    Ravi

    In my experience with Siebel 8.1.1 and BI Publisher 10.1.3.4.0 when you generate a report from a Siebel View the report will show all data visible on the view. If you wish to have only a few particular records in the report you must query for them first in Siebel then generate the report again. There is useful article describing how to generate the report for the current record but it does require some config on the applet.
    [http://siebel-essentials.blogspot.com/2009/05/siebel-bi-publisher-integration.html]
    -Fred

  • P & L report for current period,YTD and previous YTD

    I am trying to create a P & L report with the columns for current period,YTD and previous YTD,  I have include the measures as the key of columns, which by using period or YTD we can retrieve the current period and YTD column, is there as easy way to get the previous YTD? although I can get it  by using evtim to het every month and calculate the previous YTD.

    resolved, just need to bring both time and measures in the columns

  • How to  extract  data from PCD tables to create  custom activity report

    Hi Friends
    I have a requiremnt for creating custom portal activity report, even though we have
    standard report for that, we need to extract the data from the following pcd tables
    WCR_USERSTAT, WCR_WEBCONTENTSTAT,WCR_USERFIRSTLOGON,
    WCR_USERPAGEUSAGE.
    This extraced data will be used to create BW Reports.
    my questions  are
    1.How to extract the  data from   pcd tables?
    2.can i use   UME API   for  extracting the  data from the given PCD tables?
    3.Can i querry   the  PCD tables from JSPdynpage or  Webdynpro APP?
    Please guide me.
    Thanks in advance
    Ashok

    Hi Kishore,
    Refer to
    http://wiki.sdn.sap.com/wiki/display/Snippets/DirectAccesstoDatabaseTables
    http://wiki.sdn.sap.com/wiki/display/WDJava/OracleConnectivitywithEJBusingWebDynproApplication
    JDBC Connectivity with Webdynpro and Max DB
    Thanks
    Prashant

  • Query to get data for current week+13

    Hi Friends,
    I have two tables
    BACKLOG_WEEK_AFTER_ATP (LE)
    BACKLOG_ATP_GT_CW (RE)
    ** First I have to query whats the current week and year and it should come in this format ---- 2011-WK30
    columns in table BACKLOG_WEEK_AFTER_ATP are:
    ITEM_NUMBER      QUANTITY
    1N5418                 20
    1N5614                 30
    1N5806SM               10
    1N5811                  0
    2PFF6                  60columns in table BACKLOG_ATP_GT_CW are:
    ITEM_NUMBER     QUANTITY        YEAR_WEEK
    1N5418                30        2011-WK30
    1N5418                 5        2011-WK31
    1N5614                30        2011-WK32
    1N5806SM              30        2011-WK33
    1N5811                20        2011-WK32
    3EX473K1              20        2011-WK30My report should look like
    ITEM_NUMBER    2011-WK30  2011-WK31  2011-WK32  2011-WK33  ...............till 13th week
    1N5418                10         -5         -5         -5  ...............till 13t week
    1N5614                30         30          0          0  ................till 13th week
    1N5806SM              10         10         10         20  ................till 13th week
    1N5811                 0          0         20         20  ................till 13th week
    2PFF6                 60         60         60         60  ................till 13th week
    3EX473K1              20         20         20         20  ................till 13th weekTo get this report i have these conditions to keep in mind.
    1) If item_number not present in LE table and present in RE table then repeat what it is in RE table till 13th week
    2) If item_number not present in RE table and present in LE table then repeat what it is in LE table till 13th week
    3) If item_number present in LE and also present in RE table then do subtraction for RE - LE for that particular item_number till 13th week.
    4) If item_number is there in LE table but not present in RE table for current_week+1(today week comes as 29th week) then repeat the same which is there in LE table. If item is found in RE table for (example 32th week) then subtract RE -LE for that particular item_number
    Thanks in advance.
    Regards

    Hello,
    If you don't need the PIVOT display, then this may help you :
    with le as
    (select '1N5418' item_number, 20 quantity from dual union all
    select '1N5614' item_number, 30 quantity from dual union all
    select '1N5806SM' item_number, 10 quantity from dual union all
    select '1N5811' item_number, 0 quantity from dual union all
    select '2PFF6' item_number, 60 quantity from dual ),
    re as
    (select '1N5418' item_number, 30 quantity, '2011-WK30' year_week from dual union all
    select '1N5418' item_number, 5 quantity, '2011-WK31' year_week from dual union all
    select '1N5614' item_number, 30 quantity, '2011-WK32' year_week from dual union all
    select '1N5806SM' item_number, 30 quantity, '2011-WK33' year_week from dual union all
    select '1N5811' item_number, 20 quantity, '2011-WK32' year_week from dual union all
    select '3EX473K1' item_number, 20 quantity, '2011-WK30' year_week from dual
    row_gen as (
    select item_number, calc_year_week,
           row_number() over(partition by item_number order by calc_year_week) rn
    from
        (select le.item_number from le union select item_number from re) item,
        (select to_char(level*7+sysdate,'YYYY-"WK"WW') calc_year_week from dual connect by level<=13) week)
    select item_number, calc_year_week, calc_qty
    from row_gen, le, re
    where row_gen.item_number=le.item_number(+)
    and row_gen.item_number=re.item_number(+)
    and row_gen.calc_year_week=re.year_week(+)
    model
    partition by (row_gen.item_number)
    dimension by (rn)
    measures (calc_year_week, year_week, le.quantity le_qty,re.quantity re_qty,0 calc_qty )
    rules  (
    calc_qty[1]  =
        case when re_qty[cv()] is null then le_qty[cv()]
        when le_qty[cv()] is null then re_qty[cv()]
        else  re_qty[cv()]-le_qty[cv()]
    end,     
    calc_qty[rn>1] order by rn =
        case when re_qty[cv()] is null then calc_qty[cv()-1]
        else re_qty[cv()] - calc_qty[cv()-1]
        end           )
    order by 1,2;I am not sure this is the simplest way to do it, but the results seem to match your example.
    Regards,
    Sylvie
    Edited by: Troll35 on Jul 19, 2011 3:08 PM

  • How to calculate start date and last date for current week

    Dear All.
    i want to calculate the start of the current week as well as the last date of the current week, our week start from Saturday and ends of Friday i.e. Saturday is the first day of the week and Friday is the last day of the week.
    How can i acheive this in universe Designer?.
    Please help...

    Hi
    the formulas in webi will be as follows
    for startdate
    =RelativeDate(LastDayOfWeek(CurrentDate());-8)
    for enddate:
    =RelativeDate(LastDayOfWeek(CurrentDate());-2)
    Regards,
    Ranganath

Maybe you are looking for

  • How do I uninstall/reinstall Creative Cloud in it's entirety?

    Recently Acrobat XI stopped printing to pdf.  (It allows saving as pdf fine, but will not print to pdf.) I tried uninstalling Acrobat via an uninstall utility, (Revo) then downloading another copy and reinstalling, but it still would not print to pdf

  • Spontaneous forced sleep?

    My new (3 months) G4 Powerbook has begun spontaneously going to sleep. It does not appear to be a battery problem. The screen goes dark, the sleep beam begins pulsating. I can power it back up (but sometimes not right away) by depressing the command

  • PO attachment transfer to ECC - Extended classic scenario

    Hi all, We are on SRM 5.0 ECS.As standard,can the SRM PO attachments be transferred to  ECC PO?Is this possible in  ECS?If so,what are the steps?

  • Crstal Report alternate color Help?

    Hello Friends, I have a crystal report, Crystal Report contains a Table and I change the alternate color of the Rows using the following formula: if RecordNumber mod 2 = 0 then crSilver else crNoColor I want the alternate color to be within the Table

  • ITunes 10 is a massive resource hog

    After updating to iTunes 10, I noticed that my computer was running considerably slower than usual. iTunes 9 used about 2% system resources when playing music and minimized to the dock. So after checking Activity Monitor, I discovered that iTunes 10,