Data between Date Range with Business Days only

Hi All,
We have a requirement that we need to retrieve data between a data range, providing From date and To date as input.
We also have the option to Include Business Days Only through a check box which will be passed to CR 2008 through a report frame work.
Can some one help me how to display the report data within the Date Range entered and that includes only Business Days.
Thanks in advance for the help.
Regards,
Naresh.

try this formula. Lets if your date range parameter is {?date} then try this formula
@startdate:
if datepart('w',minimum({?date}))=7 then
minimum({?date})+2
else if datepart('w',minimum({?date}))=1 then
minimum({?date})+1
else
minimum({?date})
@enddate
if datepart('w',maximum({?date}))=7 then
maximum({?date})+2
else if datepart('w',maximum({?date}))=1 then
maximum({?date})+1
else
maximum({?date})
regards,
Raghavendra

Similar Messages

  • Data should be processed with one package only

    Hello,
    I need to load data from ods1 to ods2.
    The logic if the transformation requires that data should be processed with one package only. Otherwise the result will be misleading.
    I can increase the package size up to 1 mln but its not the best solution as actual numbers of records is unknown.
    What would you recommend?
    thanks

    Hi,
    We had a similar requirement for one of the projects, where data for the same key from base DSO were required in the same DP.
    We worked it out in the End routine, where during the load we sort the data package for the same key combination and delete adjacent duplicates. then we lookup in the active table of the base DSO(ODS1 in your case) to get corresponding records for the same Key combination. Carry out the computaton and then populate the data package again..
    Similar Sample Code in 3.5 update rule routine:
      SORT DATA_PACKAGE[] BY material
                           /bic/zcdpcntry .
      DELETE DATA_PACKAGE[] WHERE material       IS INITIAL OR
                                  /bic/zcdpcntry IS INITIAL .
      CHECK DATA_PACKAGE[] IS NOT INITIAL.
      DELETE ADJACENT DUPLICATES FROM DATA_PACKAGE[]
                            COMPARING material
                                      /bic/zcdpcntry.
      lit_dp[] = DATA_PACKAGE[] .
      REFRESH DATA_PACKAGE[] .
      SELECT material
             datefrom
        FROM /bic/azmd_o***00
      INTO CORRESPONDING FIELDS OF TABLE lit_cc
        FOR ALL ENTRIES IN lit_dp
      WHERE  material = lit_dp-material AND
            /bic/zcdpcntry = lit_dp-/bic/zcdpcntry.
    ***Processing KLogic..****
    Assigning to the datapackage.
        DATA_PACKAGE[] =   lit_dp[] .
    Hope this Helps..
    Regards

  • Is there a function to derive "business days" only

    Is there either an Oracle SQL built-in function or user-defined function for calculating the difference
    between two dates or between SYSDATE and a date in the database, which uses business days
    only (at least excluding weekends)?
    I'd appreciate any help on this!
    Thanks!
    Kathy Kuehnle
    [ [email protected] ]

    We solved this with the following package:
    create or replace
    package body zentr_date_functions as
      function eastern (p_year in number) return date is
        -- Calculate easter sunday (valid from 1900 to 2099)
        -- based on a Gauss algorithm
        l_a pls_integer;
        l_b pls_integer;
        l_c pls_integer;
        l_d pls_integer;
        l_e pls_integer;
        l_p pls_integer;
        function make_date(p_d in pls_integer, p_m in pls_integer, p_y in pls_integer) return date is
        begin
          return to_date(to_char(p_d, '00')||to_char(p_m, '00')||to_char(p_y, '0000'), 'DDMMYYYY');
        end;
      begin
        if p_year not between 1900 and 2099 then
          return null;
        end if;
        l_a := mod(p_year, 19);
        l_b := mod(p_year, 4);
        l_c := mod(p_year, 7);
        l_d := mod(19 * l_a + 24, 30);
        l_e := mod(2 * l_b + 4 * l_c + 6 * l_d + 5, 7);
        l_p := 22 + l_d + l_e;
        if l_p > 31 then
          if l_p = 56 and l_d = 28 and l_a > 10 then
            return make_date(18, 4, p_year);
          elsif l_p = 57 then
            return make_date(19, 4, p_year);
          else
            return make_date(l_p - 31, 4, p_year);
          end if;
        else
          return make_date(l_p, 3, p_year);
        end if;
      end eastern;
      function is_workday (p_date in date) return number as
        -- Is p_date a working day?
        l_eastern date;
      begin
        if to_char(p_date, 'DY', 'NLS_DATE_LANGUAGE = AMERICAN') in ('SAT', 'SUN') then
          return 0;
        end if;
        if to_char(p_date, 'DDMM') in ('0101', '0105', '0310', '2412', '2512', '2612', '3112') then
          return 0; -- fixed bank holidays in lower saxony, Germany
        end if;
        if to_number(to_char(p_date, 'MM')) not between 3 and 6 then
          return 1;
        end if;
        if to_number(to_char(p_date, 'YYYY')) not between 1900 and 2099 then
          return null;
        end if;
        l_eastern := eastern (to_number(to_char(p_date, 'YYYY')));
        if trunc(p_date) in (l_eastern - 2, l_eastern + 1, l_eastern + 39, l_eastern + 50) then
          return 0; -- eastern depentent bank holidays in lower saxony, Germany
        end if;
        return 1;
      end is_workday;
      -- This is what you are looking for:
      function workdays_between (p_date1 in date, p_date2 in date) return number as
        -- count number of workdays between p_date1 and p_date2 (both p_date1 and p_date2 included).
        l_count pls_integer := 0;
      begin
        for i in 0 .. p_date2 - p_date1 loop
          l_count := l_count + is_workday(p_date1 + i);
        end loop;
        return l_count;
      end workdays_between;
    end;

  • Get Business days ONLY excluding Thanks giving / Christmas etc

    I know how to exclude Saturday and Sunday to get weekdays only but how to get business days only excluding thanks giving/ Christmas/memorial day etc (based on the locale or some other setting) ?
    (If it is country- INDIA - the list of official government holidays changes, so the query should work properly depending on the country or some other setting.)

    Hello userPrasad.
    Business or working days can not only be affected regionally but also by the nature of the industry that the system is used for; not to mention that change can occur. The few systems that I've worked with have typically provided a user-maintained listing of dates to be considered as business/working days. Obviously, this would contain more data than the system and your coding would actually require, but this is normally the most straightforward presentation to the business user.
    Make it simple
    Make it obvious
    Make it usable
    Make it flexible
    Some food for thought,
    Luke
    Please mark the answer as helpful or answered if it is so. If not, provide additional details.
    Always try to provide create table and insert table statements to help the forum members help you better.

  • Display all dates between date range (Time Dimension left outer join Fact)

    All,
    I have done some searching around this issue but within all the posts regarding date variables, date prompts and date filtering I haven't seen one exactly answering my issue (maybe they are and I just dont have my head around it correctly yet).
    My report requirement is to allow a user to select a start day and an end day. The report should show all activity between those two days - AND display 0/null on days where there is no activity. That second part is where I am getting hung up.
    The tables in question are:
    TimeDim
    EventFact
    CustomerDim
    My BMM is setup as follows:
    TimeDim left outer join EventFact
    CustomerDim inner join EventFact
    If I run a report selecting DAY from TimeDim and a measure1 from EventFact with day range 1/1/2010 - 12/31/2010 .. I get a record for every day and it looks perfect because of the left outer join between TimeDim and CustomerDim.
    But .. if I add in a field from CustomerDim, select TimeDim.DAY, CustomerDim.CUSTNAME, EventFact.MEASURE1, OBIEE only returns records for the days that have EventFact records.
    This is due to the fact that the TimeDim is still outer joined into EventFact but adding in CustomerDim makes OBIEE setup an inner join between those tables which then causes only data to be returned where EventFact data exists.
    There is a way around this in this simple case and that is to define the relationship between CustomerDim and EventFact as an outer join as well. This will give the desired effect (but an outer join between these two tables is not the true relationship) and as I add additional dimensions and add additional logical sources to a single dimension in the BMM it gets complicated and messy.
    Ive also messed with setting the driving table in the relationship, etc.. but it has not given the desired effect.
    Has anyone ever encountered the need to force display all dates within a specfied range with a fact table that may not have an entry for every date?
    Thanks in advance.
    K
    Edited by: user_K on Apr 27, 2010 11:32 AM

    It worked!!!* Even my time drill downs and date based filtering still work!
    That is awesome. Never would have thought of that intuitively.
    Now, just need a little help understanding how it works. When I run my report and check the logs I can see that two queries are issued:
    Query 1: Joins the fact table to all the associated dimensions. I even changed all the relationships to inner joins (which is what they truly are). And calculates the original measure. If I copy and paste this query into sql developer it runs fine but only returns those rows that joined to the time dimension - which is what was happening before. It is correct but I wanted a record for every time dimension record.
    Query 2: Looks like the following:
    select sum(0)
    from timedim
    where date between <dateprompt1> and <dateprompt2>
    group by month *<--* this is the time dimension level specified in Query 1, so it knows to aggregate to the month level as was done in query 1
    Final Question: So what is OBIEE doing ultimately, does it issue these two requests and then perform a full outer join or something to bring them together? I couldn't see anywhere in the log a complete query that I could just run to see a similar result that I was getting in Answers.
    Thanks for all the help .. Id give more points if I could.
    K

  • Can I get the date to display along with the day and time

    can I get the date displayed with the day of week and time?

    Hi Mary, you can, but what version of OSX are you running on what Mac?
    See if this helps for starters...
    http://paulstamatiou.com/how-to-display-date-in-os-x-menu-bar

  • Generating Dates Between Date Range

    Hi,
    I have a table with test_id, a_id, start_date, end_date like the below.
    test_id a_id start_date end_Date
    861 2123 05-Dec-2009 10-Dec-2009
    861 2124 06-Dec-2009 09-Dec-2009
    864 2123 08-Dec-2009 10-Dec-2009
    864 2124 07-Dec-2009 11-Dec-2009
    I need to generate dates between the start_date and end_date like the below. Kindly help.
    test_id a_id start_date end_Date tdate
    861 2123 05-Dec-2009 10-Dec-2009 05-Dec-2009
    861 2123 05-Dec-2009 10-Dec-2009 06-Dec-2009
    861 2123 05-Dec-2009 10-Dec-2009 07-Dec-2009
    861 2123 05-Dec-2009 10-Dec-2009 08-Dec-2009
    861 2123 05-Dec-2009 10-Dec-2009 09-Dec-2009
    861 2123 05-Dec-2009 10-Dec-2009 10-Dec-2009
    861 2124 06-Dec-2009 09-Dec-2009 06-Dec-2009
    861 2124 06-Dec-2009 09-Dec-2009 07-Dec-2009
    861 2124 06-Dec-2009 09-Dec-2009 08-Dec-2009
    861 2124 06-Dec-2009 09-Dec-2009 09-Dec-2009
    864 2123 08-Dec-2009 10-Dec-2009 08-Dec-2009
    864 2123 08-Dec-2009 10-Dec-2009 09-Dec-2009
    864 2123 08-Dec-2009 10-Dec-2009 10-Dec-2009
    864 2124 07-Dec-2009 11-Dec-2009 07-Dec-2009
    864 2124 07-Dec-2009 11-Dec-2009 08-Dec-2009
    864 2124 07-Dec-2009 11-Dec-2009 09-Dec-2009
    864 2124 07-Dec-2009 11-Dec-2009 10-Dec-2009
    864 2124 07-Dec-2009 11-Dec-2009 11-Dec-2009
    Please reply at the earliest. Its very urgent. Thanks in advance.
    Regards,
    Gayathri Devi

    with t
    as
    select 861 test_id, 2123 a_id, to_date('05-Dec-2009','dd-mon-yyyy') start_date, to_date('10-Dec-2009','dd-mon-yyyy') end_date from dual union all
    select 861, 2124, to_date('06-Dec-2009','dd-mon-yyyy'), to_date('09-Dec-2009','dd-mon-yyyy') from dual union all
    select 864, 2123, to_date('08-Dec-2009','dd-mon-yyyy'), to_date('10-Dec-2009','dd-mon-yyyy') from dual union all
    select 864, 2124, to_date('07-Dec-2009','dd-mon-yyyy'), to_date('11-Dec-2009','dd-mon-yyyy') from dual
    select test_id, a_id, start_date, end_date, start_date+no-1 dt
      from t
      cross join
    select level no
      from dual
    connect by level <= (select max(end_date-start_date+1) from t)
    where case when start_date+no-1 > end_date then null else start_date+no-1 end is not null
    order by 1,2,5

  • REQUESTED DELIVERY DATE TO BE ADJUSTED WITH 2 DAYS +

    Dear All,
    in our current company for a particular company code they  has already managed to get 2 days added in the delivery requested date KETDAT from the order creation date BSTDK : We need to align this process for all orders delivered from a particular plant or storage location &   sales  organization.
    if there any user exit is present in sap where we can define that.
    please give me some suggestion it's very urgent for me.
    regards,
    Moni

    ??? This is simple customizing! Go to tx. SPRO -> Sales and Distribution -> Sales -> Sales Documents -> Document Header -> Define Sales Document Types -> click on a document and press the 'detail'-button. Scroll to the bottom. there's fields concerning you wish in section:
    Requested delivery date/pricing date/purchase order data. you can define a lead time there.

  • How to set execution time of the step with business days in the workflow

    As we know, we can set how many days later the step should be execuated after previous step. now, the problem is how to set the business days (days except sunday and sataurday) for it. any one has good solution on it.

    Hi Nick,
    In order to find the Next working day you need to check for the Factory calendar days for eg, if a workitem has invoked today and if the Approver doesn't release the workitme for which u want to send a mail/reminder to the approver after say next 5or 6 working days, you need to create a function module.
    For eg: In case of Purchase order, if the approver doesn't release the PO .
    Create a Method saying "Next working day" , in which you will be passing the import parameters : PO, Factory calendar day and the sy-datum
    and export parameter : date.
    Create Input date and No of days as container elements of the Task and in the method create a Function module
    In case of PO, consider the Factory calendar key from the T001W  by joining the table EKPO there by passing the PO.
    then pass the date, No of days(say 5 days) and the Factory calendar key  to the "WDKAL_DATE_ADD_FKDAYS" , you will get the next working day of the employee.
    Don't forget to check the Binding properly.
    Do implement this logic and check the same.
    Regards
    Sharief

  • How to transfer data between spreadsheets without using Business Objects?

    Hello, every time I try and log onto the business objects platform I keep getting "this system can be contacted but there is no central management server running at port 6400".  All I need to do is pass variables between spreadsheets. Both files are located in the same folder. Below are the links ive tried but have been unsuccessful  to pass data.
    (This link I used the swf loader component child and flash variables task Daya posted on Feb 15. However nothing loaded. The link wasnt a link i could display is in a browser. So i kept getting 0% when in preview mode.
    Passing values from dashboard to dashboard with Flash Variables
    Next I tried the following link. I did everything word for word and was able to display both files on the html page, but no link or connection between them existed. I would select a state and noting happened to the other swf files chart. Does this need to be in the Business Objects platform?
    Dashboards 4.0: Connect to an external
    Lastly , I used the link below. I followed everything and was able to get interaction from the parent to child however with only the files that were available on this thread. Their URL was this http://myxcelsius.com/wp-content/uploads/2010/10/child.swf?salesman=Schrute,Dwight. I get the concatenation but I dont get how this URL was generated? How do I develop my URL? My URL is able to display in a browser. My URL is
    http://kln-ftvp/KLNPheonix//LinkToReport.htm?fqn=MyEnterprise.Public.graphtest&run=true
    SWF Loader shows 100% instead of Dashboard.
    Even with my URL being able to display in internet explorer, I still only show 100% and a blank screen. Can anyone help me with any of the issues I am having trouble with? Your help is most appreciated. Thank you.

    It looks like you have more than one problems so it might be good to separate them out.
    Issue 1 - Logging on to BusinessObjects
    You say that when you try log on to the BO Platform you get the error message there is no central management server running on port 6400. I'm assuming you are trying to do this from the Dashboard designer.
    Does it work when you try to log on from the web browser?
    Make sure that you enter the correct system name in the system field when trying to log on from Designer. If you are unsure, either check what system name is used when you log on from your browser or check with your BO administrator.
    Issue 2 - Passing values to a child dashboard
    If you try to preview the dashboard in the designer, remember that the swf loader doesn't work in preview mode, so whatever you are trying to display won't be visible.
    First of all you need to have 2 separate flash files that works independently of each other. The one that you are planning to use as a child flash, make sure that you create the flash variables so you can pass variables to it and use them to filter your data if that is your requirement. But hold off on that for now.
    When you have 2 working flash files, save them both to the BI Launch Pad (or InfoView if you are on 3.1) and make sure they both work there. Then get the opendocument url for the child dashboard and try to open it in your browser directly using this url. If that works, use the same url in the swf viewer in the parent dashboard, save the parent dashboard back to BI Launch Pad and open it. It should now work.
    Let me know if you have any problems with these steps.
    Cheers,
    Josh

  • How can I send data from multiple range with VBA API ?

    hello everyone,
    i have one worksheet , multiple range. With addin , we can specified the range to retrieve or submit.
    In smart view  for retreive, I have the API retrieverange so  I can do the same. But for submitting data, I only have the API "HypSubmitData" and it doesn't take any paramater like a rangebut only the sheet !
    So how do you manager to do it ? one worksheet per range ?
    thanks for answers

    11.1.2.5.400 added the capability to perform range submission, however I doubt that the vba is not updated with the function. So you might have to wait for a while, or you can create a code which copied the selected cells to a hidden worksheet and perform submit from that sheet. Keep in mind that when the use make the selection, you'll have to copy the pov too.
    Regards
    Celvin Kattookaran

  • Copy data between planning area with function module

    Hi gurus!
    I'm involved in a consumer products project
    In my multiplaning area i copy "catalog code" from act to fct after a preliminary selection in a authorization layout..
    Due to increase performance I'm in need to convert the FOX which copies data from actual plan area to fct plan area after the authorization check, into a formula exit...
    This fox works fine but as you can imagine it takes a lot of time to execute cause it has to read every catalog code form the transactional data...
    here follows gross summary of the code.
    this FOX copies ACT catalog code into FCT catolg
    code by CALQUARTER  according to Catalog code
    authorization stored in AUTH version
    DATA PER TYPE 0CALQUARTER.
    DATA ENDPER TYPE 0CALQUARTER.
    DATA KEYF TYPE KEYFIG_NAME
    PER = VARV(variable)
    ENDPER = TMVL(per,4).
    catalog code is present in the level selection
    with no filter
    AUTH is the version used for set up the
    authorization in data copy (no quarte info is needed)
    IF {KEYF,AUTH,#,PLAN1}>0.
    PLAN1 I the FCT plan area, PLAN2 is the Act plan area
    DO.
    {KEYF,FCT,PER,PLAN1}={KEYF,ACT,PER,PLAN2}.
    IF PER = ENDPER.EXIT.ENDIF.
    PER=TMVL(PER,1).
    ENDDO.
    ENDIF.
    I've found many example in the forum but nothing which refers to different planning areas data copy with exit.
    I'll be gratefull to any of you who can help me to compile this function module.
    Best regards
    M91

    Hi Rakesh,
    You can use COPY/Version Management Function to do this.
    Path: Demand Planning > Environment >Copy/ Version Management
    The system takes into account only those periodicities that are common to both planning areas.
    For example, if the data is saved in months in the source planning area (PA1) but in months and weeks in the target planning area (PA2)
    the system copies to months in the target planning area and then Disaggregates the data to the storage buckets in accordance with the Time-based Disaggregation.
    hope this wil help to understand the basic concept.
    Kapil

  • Comparing Data between two tables with different structure

    Hi,
    I have 2 tables T1 and T2. Both tables have different structure. I have to check for rows missing in T1 which exist in T2 and vice-versa. I can do that using MINUS operator. But the part where the data exists in both T1 and T2, I have to compare some columns (9 columns the names of this column coming from a meta-data table) if they have same values. If not an exception has to be generated.
    Any help is appreciated.
    Thanks

    Hi,
    Whenever you need help on this forum, post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data (4) Your best attempt so far
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    Formatted tabular output is okay for (3). Type before and after the tabular text, to preserve spacing.
    What do you mean by "an exception has to be generated"?
    Do you want to raise an error?
    Do you want something to appear in the result set?
    MINUS finds rows that are in one result set, but not in another.
    INTERSECT finds rows that are in both result sets.
    Column names have to be hard-coded into the SQL statement.  If you want to write something now that will get column names from a metadata table sometime in the future, then you have to use dynamic SQL.  SQL*Plus sometimes has quick and dirty ways of doing dynamic SQL, so say whether you're using SQL*Plus or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Copying data between two tables with different structures

    I have two tables. second table has three extra fields at the end. How can I copy data from first table to the other? I tried the following but it does not seem to work:
    INSERT INTO second_table ((select * from first_table),'text','text',5)
    Please help. Thanks

    INSERT INTO second_table SELECT col1, col2, col3, .., 'text', 'text', 5 FROM first_table;
    Cheers!
    r@m@

  • Sharing data between two iPads with different iclouds

    Hi basically I want to be able to link notes etc from my iPad to my bosses iPad, obviously we have different iCloud's and we don't mind using a third party app. anything anyone can suggest.

    Thank you! The itunes accounts are on different computers. The movies I want to share are digital downloads that came with movies I purchased. Example Rio. My son has an Ipad2 and and I have an ipad. I mainly want to be able to share the movies with him on his ipad.

Maybe you are looking for

  • IChat AV quits when video chat invitee responds

    I have been trying to have a video conference with my daughter for the last few days. If she is available, I send her a video chat invitation. She gets the invitation, but as soon as she accepts it, iChat quits. We've had a lot of video chats in the

  • CD read at 2.5 MB/sec, too slow?

    Hello! In the 2 weeks I've had my MacBook Pro (15", 2.2 Core 2 Duo, 10.5.2) i've noticed that CDs seem to read fairly slowly. THat is, more slowly than my old 15", 1.67 Ghz PowerBook G4. So, I decided to test that. I took a CD, and used disk utility

  • I have had to go to a new computer, Have I lost all that I had bought?

    So I had a itunes set up and now have a new computer. Have I lost all the songs I bought on my old computer?

  • Problems printing PDF from Reports

    Hi, I'm having a problem with the Report's way of generating pdf-documents. The report that Reports was supposed to create have some bullets where but when Reports converts the document to pdf it sometimes insert asterisks instead of bullets...but on

  • User creation failed - BAM

    I tried to create an user through Oracle BAM administrator. But it is throwing the following error. "This login is not currently known to be a valid login." Can any one help me to solve this.