Calculation of the entities order!

I was auditing the code written by someone else and found a piece of code for which I have my doubts about. It looks like this:
HS if. Entity.Member () = 'Entity1' and HS. Value.Member () = "Entity currency <>" Then
HS. Exp ' an account1 # = E #Entity2.A #Account2.V # < Parent currency > "
End If
know, means that entity1 retrieves a translated value entite2, which raises the question: How do we know that translation of entite2 always occur before the entity1 calculated?

Another consideration on the above code is the following: If the entity1 is already calculated with status OK and there is a change of entité2, entity1 will always show an OK status.

Please give me your opinion. More specifically, we know the sequence that the entities are calculated? If we know it, we control it?

Thank you
-Kostas

Entities of basis that calculate everything first, then their parents thereafter. Apart from this sequence, there is no way in HFM to control the sequence of calculation of entities, unless you introduce your own mechanism to calculate them in the order (which would be a large part of the work full of potential for errors). Do not write the rules that require a sequence of entities due to this inability to predict or control the order. For this reason, it may be difficult to have rules that require entities to read data from other entities. The only exception to this lies in consolidation rules, and even in this case, you can manage only siblings under a common parent.
-Chris

Tags: Business Intelligence

Similar Questions

  • Rapid calculation of the exponential decay constants

    Hi all

    I try to develop a routine that quickly calculates the exponential decay of a given waveform constant.  I use two different techniques, dealing with the calculation of the directions and another using corrects successive integration (LRS).  The two usually give the correct time for the input waveform even constant with a significant amount of noise.  The LRS solution is significantly less sensitive to noise (desirable), but much more slowly (DFT computations run the order of 10s of microseconds for a waveform pt 1000, while the LRS, such that it is coded in Labview, running at about 1.5 ms).  The LRS technique has been developed by researchers at the George Fox University in Oregon, and they claim that they could perform some computation time on the order of 200 US for both techniques.  I have been unable to reach this time with the LRS technique (obviously) and attempted to use a node of the library Call to call a dll compiled this code in C.  However, at best, I get a growth factor 2 in speed.  In addition, additional calculations using the dll seem to be additive - i.e. for four calculations similar running in the same structure with no dependence on each other, the total computation time is about 4 times that of one.  In my case, this is not enough because I try to calculate 8 x to 1kH.

    Looking through the discussion, I have been unable to determine if I should wait for a performance for C gain well written on Labview well written (most seem to ask why you want to do something external).  In any case, I join the code, then you can be the judge as to if it's well-written, or if there is no improvement in performance.  The main function is the Test analysis Methods.vi that generates a wave exponential scale, offset and noise and then the decay constant tau is calculated using the VI is Tau.vi.  In addition, I am attaching the C code as well as the dll for solving the equations of LRS.  They were coded in Labview 8.6 and the C has been encoded using the latest version of Visual C++ Express Edition from Microsoft.  Themain VI uses the FPGA VI module ' Tick count to determine the rate of computation in microseconds, so if you do not have this module you should remove this code.

    Any thoughts are appreciated.  Thanks, Matt

    Hi Matt,

    After changing the summation loop in your calculation of CWR, the routine runs as fast (or faster) than the variants of the DFT... Anyway: check the results to be sure it is still correct.

  • How to create the sample Order Manager of Transformation (OTM) cartridge

    Hi all

    I tried quite pointless to create a cartridge OTM sample.

    I created a sample orchestration cartridge, and it has 2 functions: supply and FulfillBilling with a dependence on Provisioning for FulfillBilling inside a model completion Service.Voice.

    I created an example of template with the design template project, and it has created some entities by default like stocks and other stuff.

    First, I created a fixed domain in the conceptual model. Then added a product "Voice_PS". I have create a CFS called "Voice_CFS" under "Voice_PS" with a primary relationship. I added the fulfillment of coceptual model 'Voice_FP' product 'Voice_PS '.

    After that, I created MappingRule which I kept as a default because I haven't created any parameter of Voice_PS.

    Then I create the parameter bindings of controls and that I kept also by default because I didn't take all the parameters command line group specifications.

    Then I called design model to create a Service order. This gave me the sequence of Transformation and in the first step, I added simple context Type for parameter OLI ProductSpec = "Service.Voice."

    I use the same specification of element of order for the transformation of source and target texts. To do this, I checked the box «Model order» distributed support

    I created the processing Manager and mapped the area and the sequence of Transformation.

    After that, I marked the "Transformation Manager invoke" the Orchestration process verified and gave to the service provider that calculate the Service order.

    I pulled an order after you have configured all of this and I'm getting line continuation in the DEBUG log.

    < 22 January 2015 07:56:26, 289 PM IST > < DEBUG > < transformation. OrderTransformationManager > < ExecuteThread: "14" for queue: 'oms.ws.http' > < transformation OTM invoked with cartridgeId: 353, service provider: {OracleComms_Model_Base_Cartridge/1.0.0.0.0}Calculate_Service_Order, 3 points of order >}

    However if I open the order I can't control elements transformed under the control elements in the left panel.

    What I'm doing here wrong or missing?

    In the tab "Property references" specification of element of order there is also a field 'Order recognition Item property' which I mapped to a property returning my original ESP entity that was the Product "Voice_PS" entity

    However, I constantly get this error for her.

    < 23 January 2015 10:12:35, 832 IST AM > < WARN > < generation. XQueryEntityResolver > < ExecuteThread: "14" for queue: 'oms.ws.http' > < can't find the person identified by namespace = COM_SalesOrderFulfillment; name = Voice_PS; type = T = OrderItemParameterSpecificationType @http://xmlns.oracle.com/communications/ordermanagement/model>

    I have a feeling that the OSM requires no conceptual entity to this place but what it should be, that's what I don't get.

    Any little help will be welcome, because I feel really bad for the last 3 days.

    Hi all

    After almost a month to research on the OTM configuration, I was able to successfully create a cartridge with OTM.

    The thing is that oracle has tried several things to ensure that you do not work on OTM without taking training from Oracle University. However working for an Indian Council COMPUTER company, cost of training is something that approve all IT managers. So now I would like to register 4 things I was missing and which are very important for the configuration of the OTM: -.

    1. one thing that has not always been productSpecMapping.xml with the conceptual entities. This was achieved after dependence conceptual cartridge cartridge model fulfilment and realisation configuration and then the construction of the entire workspace. Reason for satisfaction was derived from this mapping.

    2. Although the DS is built as entities in the workspace are available for configuration, however, when you select the realization within the OSM entities the conceptual entities are not visible. Only if you bring a dependence of the cartridge to cartridge of the conceptual model to the OSM cartridge where you configure realization so only the conceptual entities begin to appear.

    So in my cartridge missed me 2 achievements. One was the realization of the conceptual model entity model fulfillment OSM entity fulmillment. Second has been the achievement of entity area conceptual funcational to the OSM order entity.

    3. the next thing that I configured and which was essential was 'container of entities in the common model. This tab appears on all files in all projects cartridge. Basically this allows you to select the project template that contribute to this project. As soon as I have it configured OSM began to detect OrderItemParameterSpecificationType entities.

    4. the wierdest configuration that I found was this one. After trying the previous point, I found that even if the entities are now be created, but again I was getting OrderItemSpecificationType entity not found. So I cheked in the cartridgeBuild folder to check what is created in the backend before deployment. I found that for some reason any was not Voice_PS but Voice_PSSpec. So I started concatinating "Spec" to all entities of the product in the order entering the property of recognition element OrderItemSpecification order. Please note that my order of recognition property point was not "Voice_PSSpec" but rather the value "qualifiedName" derived from the productSpecMapping.xml to the node with the value of the name attribute as "Voice_PS". For more information look at this post of me some time. OSM 7.2.4 cartridge

    And now my cartridge started grateful OTM. However I did a wrong configuration in order for transformed model controls inside functions so I quickly corrected and pulled another order. This time I could see the elements of order and turned the control elements. Phew! Finally his work.

    Now I spent enough time on this, I'd be happy to help those who are struggling to set up OTM.

    Kind regards

    Magalhaes

  • Unit test: calculation of the length of the different columns in recordsets provided and received led to false a test failure

    Dear team of SQL Developer,

    It seems that the calculation of the length of the column in the expected and received recordsets behaves differently in some cases (when stored proc variables are used in the generation of the REF CURSOR, despite the explicit definition of the type of record): the length of the header and the length of the value in the set of records received are truncated to arbitrary length based on the returned value which leads to a false failure of a unit test. I.e. registries are the same in both sets of records, but the test run fails to the comparison of the recordsets because of different length. Please see the screenshot below:

    Expected_and_Received_RecordSets.jpg

    Here's the test case if you need to reproduce the problem/bug in your environment:

    1. use the default schema of HR of the Oracle examples package that comes with an 11 g database.

    2. change the HR. Table EMPLOYEES with the addition of a new column VARCHAR2 (4000) LONG_LAST_NAME:

    ALTER TABLE HR. EMPLOYEES

    ADD (LONG_LAST_NAME VARCHAR2 (4000));

    Update hr.employees set long_last_name = last_name;

    commit;

    3. create a PKG_TEST2 package with the source code below in the HR schema:

    ----------------------------------------------------------------------------------------------------------------------

    create or replace PACKAGE PKG_TEST2 AS

    TYPE EmployeeInfoRec IS RECORD

    (

    long_last_name employees.long_last_name%TYPE,

    first name employees.first_name%TYPE,

    E-mail employees.email%TYPE

    );

    TYPE EmployeeInfoRecCur IS REF CURSOR RETURN EmployeeInfoRec;

    FUNCTION getEmployeeInfo (p_Emp_Id employees.employee_id%TYPE)

    RETURN EmployeeInfoRecCur;

    END PKG_TEST2;

    ----------------------------------------------------------------------------------------------------------------------

    CREATE OR REPLACE PACKAGE BODY PKG_TEST2 AS

    FUNCTION getEmployeeInfo (p_Emp_Id employees.employee_id%TYPE)

    RETURN EmployeeInfoRecCur AS

    v_EmployeeInfoRecCur EmployeeInfoRecCur;

    v_LongLastName varchar2 (4000);

    BEGIN

    Select long_last_name from v_LongLastName

    employees

    where employee_id = p_Emp_Id;

    --

    OPEN FOR V_EmployeeInfoRecCur

    V_LongLastName SELECT long_last_name,

    first name,

    E-mail

    This_is_very_long_table_alias employees

    WHERE employee_id = p_Emp_Id

    order by 1 CSA;

    --

    RETURN v_EmployeeInfoRecCur;

    EXCEPTION

    WHILE OTHERS THEN

    LIFT;

    END getEmployeeInfo;

    END PKG_TEST2;


    ----------------------------------------------------------------------------------------------------------------------

    4. create a unit test for the PKG_TEST2.getEmployeeInfo stored procedure: (click the command create Test, select the stored procedure, click Ok for the pop-up message, click Next, click Finish).

    5. update the default value of dynamic query of value with the one below and save/post changes.

    Select the cursor)

    SELECT long_last_name,

    first name,

    E-mail

    Employees

    WHERE employee_id = idqry.employee_id

    order of the 1 CAD

    ) RETURNS $,.

    idqry.employee_id as P_EMP_ID

    from (select employee_id

    employees

    where rownum < = 5) idqry

    6. run the unit test newly created in the debug mode to display the shot.

    Thus, the record type 'EmployeeInfoRec' in the package clearly defines the LONG_LAST_NAME as VARCHAR2 (4000) through reference for the data type of column in the referenced table.

    But for some reason, the SQL Developer does not calculate correctly its length in the recordset "Receipts" If a variable is used (could be one as variable simple varchar2 in this reproducible test or complex variable of type of the object).

    Any ideas on that? Looks like another bug...

    Thank you

    Val

    The bug has been reproduced by the SRB and documented within the system of Support of Oracle SQL Developer team to pick it up:

    Bug 19943948 - TEST UNIT RETURNS EXPECTED ERROR: [LONG_LAST_NAME

    Hope the bug name can later be changed to something more descriptive, but it is not really... my only concern is the speed at which the known bugs would be fixed...

    Thank you

    Val

  • Intel ARK Intel Xeon processor E5-2620 confused v3 on the calculations for the CPU.

    Hello

    I know that this topic is tedious, but the I am not sure of the ESXi County. Now I have to buy new servers, I have not in a long time. Intel CPU base use hearts and son. Intel Xeon processor E5-2620 v3, carrots = 6; Son = 12 and Hyper-threading.

    As defined by Intel:

    Carrots is a material term that describes the number of independent CPUs in a single computer component (die or chip).

    Threads, is a term for software for the base ordered sequence of instructions that can be passed by or handled by a single processor.

    The total number of processor on an ESXi host hearts would be 6 * 12 = 72? or 6 If the Threads do not count in the calculation; which is I guess?

    The number of logical processors on an ESXi host? (6 * 12) * 2 = 144? or 12 If the Threads are not count in the calculation; which is my guess?

    http://Ark.Intel.com/products/83352/Intel-Xeon-processor-E5-2620-v3-15m-cache-2_40-GHz

    Thank you

    DRUMDUDESAN

    Each physical heart can handle essentially only one thread at a time. With active HyperThreading is 2 by heart physical threads.

    So 12 son is the result of:

    6 x 2-wire hearts each = 12 threads total

    that presents itself as 12 logical processors in vSphere.

    André

  • Calculation of the total quantities in SQL

    Hello gurus,

    I have a table that stores the quantities ordered with arrival dates and order ID this table creates a new records each time the quantity changes. So I was wondering how we could do this calculation in SQL.

    Let's say I have Order ID = 218, so order Date 7/1/2103 sentence = 1100 and then for the same command id = 218 ordered = 1500 (changes).

    So I want to calculate a total quantity for order number = 218

    from the date = 01/07/2013 until the quantity of calcuation changes is (IE until 14/07/2013) = 14 * 1100 = 15400

    and for the 15/07/2013 order quantity = 1500

    TOTAL AMOUNT = 16900

    The following DDL data and sample:

    CREATE TABLE XX_ORD_QNTY
    (
    INT_ID NUMBER (15),
    ORD_DATE DATE,
    ORD_QNTY NUMBER (15),
    ORD_ID NUMBER(15)
    );
    
    
    INSERT INTO  
    XX_ORD_QNTY (INT_ID , ORD_QNTY , ORD_DATE , ORD_ID) VALUES ( 1001, 1100 , TO_DATE('07/01/2013','MM/DD/YYYY') , 0218 );
    INSERT INTO  
    XX_ORD_QNTY (INT_ID , ORD_QNTY , ORD_DATE , ORD_ID) VALUES ( 1002, 1500 ,TO_DATE('07/15/2013','MM/DD/YYYY') , 0218 );
    INSERT INTO 
    XX_ORD_QNTY (INT_ID , ORD_QNTY , ORD_DATE , ORD_ID) VALUES ( 1003, 1250 ,TO_DATE('07/13/2013','MM/DD/YYYY') , 0224 );
    INSERT INTO 
    XX_ORD_QNTY (INT_ID , ORD_QNTY , ORD_DATE , ORD_ID) VALUES ( 1004, 700 , TO_DATE('07/1/2013','MM/DD/YYYY') , 0224 );
    INSERT INTO 
    XX_ORD_QNTY (INT_ID , ORD_QNTY , ORD_DATE, ORD_ID) VALUES ( 1005, 1150 ,TO_DATE('07/10/2013','MM/DD/YYYY') , 0224 );
    INSERT INTO 
    XX_ORD_QNTY (INT_ID , ORD_QNTY , ORD_DATE , ORD_ID) VALUES ( 1006, 500 , TO_DATE('07/17/2013','MM/DD/YYYY') , 0388 );
    INSERT INTO 
    XX_ORD_QNTY (INT_ID , ORD_QNTY , ORD_DATE , ORD_ID) VALUES ( 1007, 350 , TO_DATE('07/01/2013','MM/DD/YYYY') , 0388 );
    INSERT INTO 
    XX_ORD_QNTY (INT_ID , ORD_QNTY , ORD_DATE , ORD_ID) VALUES ( 1008, 550 , TO_DATE('07/04/2013','MM/DD/YYYY') , 0388 );
    INSERT INTO 
    XX_ORD_QNTY (INT_ID , ORD_QNTY , ORD_DATE , ORD_ID) VALUES ( 1009, 350 , TO_DATE('07/13/2013','MM/DD/YYYY') , 0388 );
    
    
    COMMIT;
    

    Expected results of the SQL:

    ORD_ID | TOTAL_QNTY

    --------------------------------

    0218 |   16900

    0224 |   9850 (9 * 700 + 2 * 1100 + 1250)

    0388 |   7000 (3 * 350 + 8 * 550 + 3 * 350 + 500)

    I thought to store the previous values and previous dates to calculate the basis of this, could just point me in the right direction please.

    Thanks in advance.

    Hello

    Whenever you have a question, please post a small example data, the (correct) results you want from this data, as well as an explanation of how you get these results from these data.

    If the sample data was published earlier in the same thread, just say it; There is no need to post again exactly the same.

    If the results depend on the parameters (for example p_date1 and p_date2) then after two or three different sets of parameters and the results you want from the same data of sample for each game.

    It's the resulrars that you want from the data of sample you posted earlier, given parameters July11, 2013 and 25 July 2013?

    ORD_ID TOTAL_QNTY
    ---------- ----------
    218 5900
    224 3550
    388 2150

    Here's a way to get these results:

    WITH params AS
    (
    SELECT TO_DATE (11 July 2013 ", ' MM/DD/YYYY') AS p_date1
    , TO_DATE (15 July 2013 ", ' MM/DD/YYYY') AS p_date2
    OF the double
    )
    got_n_days AS
    (
    SELECT q.ord_qnty, q.ord_id
    , The LEAST (NVL (in ADVANCE (q.ord_date) OVER (PARTITION BY q.ord_id
    ORDER BY q.ord_date
    )
    q.ord_date + 1
    )
    p.p_date2 + 1
    ) - GREATEST (q.ord_date
    p.p_date1
    ) AS n_days
    OF xx_ord_qnty q
    CROSS JOIN params p
    )
    SELECT ord_id
    , SUM (ord_qnty * n_days) AS total_qnty
    OF got_n_days
    WHERE n_days > 0
    GROUP BY ord_id
    ORDER BY ord_id
    ;

  • Remove or exclude items from the tab order

    In a part of a form I design, the user is supposed to enter several numbers in a table, and down the two numbers are calculated automatically for them.

    I explained in the instructions for the form that some fields are calculated automatically, but actually, I don't have room under the actual shape to add a note next to each calculated field, remind people of that.  I added the code so that if a user tries to click on the automatically calculated field, a messagebox will appear explaining that the field is automatically calculated.  However, I don't want such a box to come if someone presses the Tab right through objects on this page.  It would be boring.

    What I want is to be able to exclude these two digital order alltogether tab fields.  Adobe should simply ignore these fields when a user through tabs.  I can't figure out how to do it right.  Is there a way?  Other suggestions?

    Thank you

    Set the fields you want ignored on read-only in the object under value tab > Type and go to the XML Source tab. On the XML Source tab, hit Ctrl-h to open a find and Replace window, find readOnly and replace it with the object. The fields will be so completely ignored in the tab order. If they are already calculated read-only, then you need only to do search and replace.

    djaknow

  • [8i] help with function with parameters (for the calculation of the work)

    Let me start by saying, I've never written a function before, and I do not have access to create a feature in my database (that is, I can't test this feature). I am trying to achieve a function I can ask my IT Department to add for me. I hope that someone can take a look at what I wrote and tell me if this should work or not, and if it's the right way to go to solve my problem.

    I'm creating a function to make a very simple calculation of work (add/subtract a number of days to a date in the calendar).

    The database, I work with has a table with the schedule of work. Here is a sample table and sample data, representative of what is in my work table calendar:
    CREATE TABLE caln
    (     clndr_dt     DATE,
         shop_days     NUMBER(5)
         CONSTRAINT caln_pk PRIMARY KEY (clndr_dt)
    );
    
    INSERT INTO     caln
    VALUES (To_Date('01/01/1980','mm/dd/yyyy'),0);
    INSERT INTO     caln
    VALUES (To_Date('01/02/1980','mm/dd/yyyy'),1);
    INSERT INTO     caln
    VALUES (To_Date('01/03/1980','mm/dd/yyyy'),2);
    INSERT INTO     caln
    VALUES (To_Date('01/04/1980','mm/dd/yyyy'),3);
    INSERT INTO     caln
    VALUES (To_Date('01/05/1980','mm/dd/yyyy'),3);
    INSERT INTO     caln
    VALUES (To_Date('01/06/1980','mm/dd/yyyy'),3);
    INSERT INTO     caln
    VALUES (To_Date('01/07/1980','mm/dd/yyyy'),4);
    INSERT INTO     caln
    VALUES (To_Date('01/08/1980','mm/dd/yyyy'),5);
    INSERT INTO     caln
    VALUES (To_Date('01/09/1980','mm/dd/yyyy'),6);
    INSERT INTO     caln
    VALUES (To_Date('01/10/1980','mm/dd/yyyy'),7);
    INSERT INTO     caln
    VALUES (To_Date('01/11/1980','mm/dd/yyyy'),8);
    INSERT INTO     caln
    VALUES (To_Date('01/12/1980','mm/dd/yyyy'),8);
    INSERT INTO     caln
    VALUES (To_Date('01/13/1980','mm/dd/yyyy'),8);
    INSERT INTO     caln
    VALUES (To_Date('01/14/1980','mm/dd/yyyy'),9);
    The table includes since 01/01/1980 but 31/12/2015.

    I have written (and validated) this parameter query that performs the calculation of my working day (mday):
    SELECT     cal.clndr_dt
    FROM     CALN cal
    ,     (
         SELECT     cal.shop_days+:mdays     AS new_shop_days
         FROM     CALN cal
         WHERE     cal.clndr_dt     =:start_date
         ) a
    WHERE     cal.shop_days     = a.new_shop_days
    AND     ROWNUM          =1
    ORDER BY     cal.clndr_dt;
    Based on this request, I created the following function (and I have no idea if it works or if the syntax is right, etc..):
    CREATE OR REPLACE FUNCTION add_mdays 
         (start_date     IN DATE,
         mdays          IN NUMBER(5))
    RETURN     DATE 
    IS
         new_date DATE;
    BEGIN
    
         SELECT     cal.clndr_dt
         FROM     CALN cal
         ,     (
              SELECT     cal.shop_days+mdays     AS new_shop_days
              FROM     CALN cal
              WHERE     cal.clndr_dt     =start_date
              ) a
         WHERE     cal.shop_days     = a.new_shop_days
         AND     ROWNUM          =1
         ORDER BY     cal.clndr_dt;
    
         RETURN     new_date;
    
    END add_mdays;  //edit 9:31 AM - noticed I left off this bit
    I'm also not sure how to do to have the function handle results that would return a date outside the range of dates that appear in the table (prior to 01/01/1980 or after until 31/12/2015 - or, another way to look at what was, before the caln.clndr_dt or the caln.clndr_dt MAX value MIN value).

    My goal is to be able to use the function in a situation similar to the following:

    First of all, here is a sample table and data:
    CREATE TABLE orders
    (     ord_no          NUMBER(5),
         plan_start_dt     DATE,
         CONSTRAINT orders_pk PRIMARY KEY (ord_no)
    );
    
    INSERT INTO orders
    VALUES (1,To_Date('01/08/1980','mm/dd/yyyy'));
    INSERT INTO orders
    VALUES (2,To_Date('01/09/1980','mm/dd/yyyy'));
    INSERT INTO orders
    VALUES (3,To_Date('01/10/1980','mm/dd/yyyy'));
    And here's how I would use my function:
    SELECT     orders.ord_no
    ,     orders.plan_start_dt
    ,     add_mdays(orders.plan_start_dt, -3) AS prep_date
    FROM     orders
    Thus, the function would allow me to come back, for each command in my table of orders, the date is 3 days working (mdays) before the start of the plan of each order.

    I go about it the right way? I have to create a function to do this, or is there a way for me to integrate my request (which makes my mday calculation) in the example query above (eliminating the need to create a function)?

    Thank you very much in advance!

    Published by: user11033437 on February 2, 2010 08:55
    Fixed some typos in the last insert statements

    Published by: user11033437 on February 2, 2010 09:31 (fixed some syntax in the function)

    Hello

    Ah, referring to Oracle 8 and is not not able to test your own code makes me nostalgic for the good old days, when you have entered your cards and led to a window to the computer center and waited an hour for the work to be performed and then seen printing to find that you had made a typo.

    If you write functions, you should really test yourself. Like all codes, functions forge be written small not: write a line or two (or sometimes just a part of what would later become a single line), test, make sure it is running properly and repeat.
    Ideally, your employer must create a pattern of development in a development database that you can use.
    You can legally download your own instance of Oracle Express Edition free; just be careful not to use features that are not available in the database where the code will be deployed.

    You need a function to get the desired results:

    SELECT       o.ord_no
    ,       o.plan_start_dt
    ,       MIN (e.clndr_dt)     AS prep_date
    FROM       orders     o
    ,       caln          l
    ,       caln          e
    WHERE       l.clndr_dt     = o.plan_start_dt
    AND       e.shop_days     = l.shop_days - 3
    GROUP BY  o.ord_no
    ,            o.plan_start_dt
    ;
    

    It would be more effective (and somewhat simpler) If you've added a column (let's call it work_day) identified whether each line represents a work_day or not.
    For each value of shop_days, exactly 1 row will be considered as a working day.
    Then, the query may be something like:

    SELECT       o.ord_no
    ,       o.plan_start_dt
    ,       e.clndr_dt          AS prep_date
    FROM       orders     o
    ,       caln          l
    ,       caln          e
    WHERE       l.clndr_dt     = o.plan_start_dt
    AND       e.shop_days     = l.shop_days - 3
    AND       e.work_day     = 1
    ;
    

    You can use the analytic LAG function to populate the work_day column.

    A function would certainly be useful, although perhaps slower.

    The function you have posted has some errors:
    an argument can be stated under NUMBER (5); Just NUMBER.
    (b) when you SELECT in PL/SQL, as you do, you must SELECT a variable to store the results.
    (c) ROWNUM is arbitrary (making it useless in this problem) unless you draw a neat subquery. I don't think you can use ORDER BY in subqueries in Oracle 8. Use the ROW_NUMBER analytic function.
    (d) the service must end with an END statement.

    Given your current caln table, here's how I would write the function:

    CREATE OR REPLACE FUNCTION add_mdays
         ( start_date     IN           DATE          DEFAULT     SYSDATE,
           mdays          IN           NUMBER          DEFAULT     1
         )
    RETURN     DATE
    DETERMINISTIC
    IS
         --     add_mdays returns the DATE that is mdays working days
         --     after start_date.  (If mdays < 0, the DATE returned
         --     will be before start_date).
         --     Work days do not include Saturdays, Sundays or holidays
         --     as indicated in the caln table.
    
         new_date     DATE;          -- to be returned
    BEGIN
    
         SELECT     MIN (t.clndr_dt)
         INTO     new_date
         FROM     caln     f     -- f stands for "from"
         ,     caln     t     -- t stands for "to"
         WHERE     f.clndr_dt     = TRUNC (start_date)
         AND     t.shop_days     = f.shop_days + TRUNC (mdays)
         ;
    
         RETURN     new_date;
    END     add_mdays;
    /
    SHOW ERRORS
    

    Production code forge be robust (which includes "fool-proofing").
    Try to anticipate what people errors might appeal to your function and correct for them where possible.
    For example, if it only makes sense for start_date at midnight, mdays to be an integer, use TRUNC in the function where soembody passes a good value.
    Allow default arguments.
    Comment of your function. Put all comments within the service (i.e. after CREATION and before the END) so that they will remain in the data dictionary.
    If, given the same arguments, the function always returns the same value, mark it as DETERMINISTIC, for efficiency. This means that the system will remember the values transmitted rather than to call the function whenever it is said to.

    I wish I could score questions such as 'Correct' or 'useful '; you get 10 points for sure.
    You posted CREATE TABLE and INSERT statements (without even be begged).
    You gave a clear description of the problem, including the expected results.
    The code is well formatted and easy to read.
    All around, one of the more thoughtful and well written questions I've seen.
    Play well! Keep up the good work!

    Published by: Frank Kulash, February 2, 2010 13:10
    Added to my own version of the function.

  • Bug during import of calculation and the point of application

    Hello

    I created a component export file which contains, among other things, a part of the application and a calculation of the claim on this point. Looking at the export file, this is the order of events:

    +...+
    Create calculations of the application
    Create the application point
    +...+

    However, when I import this file in our test environment, the point of application is created but not calculated. In fact, if I create the calculation manually and re - import the file, the calculation is actually deleted! However, if I change the import file and to reverse the order of events:

    +...+
    Create the application point
    Create calculations of the application
    +...+

    .. .it works very well. Is this a known bug?

    I use Apex 3.0 on Oracle 10 g btw.

    Thank you!
    Luis

    Luis - I filed a bug for the problem of calculation/pos. The problem is that a trgger on wwv_flow_items removes the corresponding calculations and the way in which the element is replaced is to remove it first and then re-create.

    The last date of update for components is not very reliable on this report. I wouldn't want to ignore them.

    Scott

  • I'm looking for the third order intercept point

    How to find the point of interception of third order of my iphone 6? There is a sheet with all the technical specifications in relation to the my phone gsm modem. Thank you

    No, Apple does not publish or release this level of technical specifications to the public.  Since the 3rd order intercept is a purely mathematical concept for such low power as a smart phone device, I imagine that these kinds of data are unknown outside of Apple's own engineering group (or Foxconn I guess)?

  • Hear an album after another in the natural order

    In iTunes, there is an 'Album of the artist' option which allows me to listen to the tracks of each album in the natural order, one album after another. This seems not possible on my iPod Nano (6th). Does anyone have a suggestion? Classical music lover I find it confusing to have a concert mixed movements. BTW, there is a function to play all the tracks of all the photos in alphabetical order, but it's also discomforting

    Create a smart playlist that includes all the songs in your iTunes library.  I have a window Edit smart playlist list that looks like this

    This playlist has ALL your songs.  If this selection is too large to fit on your iPod nano, you can add additional rules to the smart, such as playlist

    Kind is classic  (all songs from the classical music should have entry kind of 'classical' music)

    The artist is [artist name] (create a separate smart playlist for each favorite artist)

    You can also use the points to Match only checked box, in order to limit the smart playlist of songs that are archived in the library.

    NOTE: You can use normal playlist instead and add songs manually.

    See the playlist in iTunes and use the sort order of the artist Album .  Set up synchronization for include the playlist.  If you synchronize library of ensemble music, it is included automatically.  Sync the iPod.  When you use your iPod, play songs in this playlist (with iPod a play in-order).

  • When I include photos from a folder in the Photos app in the dock, and I have created an album for them, their changes. It is important for me to keep them in the same order that they were in the file. (It's a numerical order). Any solution?

    Recently, I switched from PC to Mac, and I transferred all my files photo. Now I am their integration in the Photos app in the dock (by dragging the file etc). But when I include photos from a folder in the Photos app in the dock, and then create an album for them, their order in the album change of what it is in the file. It is important for me to keep them in the same order that they were in the file. (In the file it is in numerical order). Any solution?

    You can drag and drop to any order in your albums.

  • Keep the build order when replacing image?

    Hi guys this problem has plagued me for a while.

    I create a video model in Keynote. The intro slide has a video file (locked) followed by an (unlocked) image and finally another video file (locked). The three of them follow a specific build order with delays, which in turn creates the complete animation.

    I want that the user don't just replace this the Middle image on the slide with one of their choice.

    The problem is, once replace it user order image, positioning of the image and delay in construction are lost. Unfortunately I don't think users are sophisticated enough to follow instructions on how to set the build order, then replace the timing delay, the image needs.

    Is there anyway someone (with a limited understanding of Keynote) can replace the Middle image without compromising the build order?

    Thank you!

    Use an image placeholder:

    • Add a picture to the slide in the format (vertical or horizontal)
    • position and size according to the needs
    • Add a formatting required (picture frame, shadow, etc.)
    • Select the image then: Inspector > Format > advanced > define as media placeholder

    users drag and drop any image on the support of the place that adopts the formatting of the placeholder and keep the animation settings

  • Cannot complete the order after the iPhone booking 7 during the pre-order?

    Not sure if this is the appropriate place to ask... but did anyone encounter this problem with their iPhone 7 pre-order?

    After that I tried to place an order for the iPhone 7 more during the pre-order, I received an email from the Apple Store saying that my iPhone had been reserved and provided me with a reservation number. They said that they send an email when they were able to reach the carrier systems so I could place my order. Very quickly after I got a follow-up email confirming the booking number and was told that I could now go ahead and place my order. I have connected to the Apple Store, who acknowledged my reservation number, almost all of the screens orders went through, but when I hit continue to confirm the pricing plan that I had selected, the next screen shows the page of 'the page you are looking for is not found' dreaded.

    E-mail with the reservation told me that I don't have that until 4 PM PDT 9/10 to complete this order. Everyone knows this! I tried through the app store of Apple, Safari, and Chrome... and always get the same question. I've been on hold with Apple now for 45 minutes trying to get through, and they don't take chat requests. I'm so frustrated! Help!

    The site is probably hammered with requests for pre-order. I'll try again later if I were you.

  • How can I make my iPod Nano (7th generation) read albums in the correct order?

    I just bought a new Ipod Nano (7th generation) and synchronized my entire library.

    Now I want to listen to an album, but it seems that this system is unable to sort the pieces by number.

    Some are in good order, while other aren´t and when you listen to an album, it's really the most

    annoying as I ve ever had with any mp3 player.

    I looked for a possible system behind this and everything that I could find was, which instead of the title number the

    titles are sorted by add date. Is it possible to fix it?

    In addition, a way to contact support directly without having to CALL them?

    Sorry, but with a system that I had to pay € 150, this shouldn´t certainly happen...

    For a general context, see grouping of tracks in albums . Albums play in the wrong order when metadata numbers or sort of disk are set inconsistently. Playlists in iTunes can also be set to play in a different order than shown that can sometimes be confusing. Album by artist upward is usually the most sensitive order and can be copied to the reading order by right-clicking on the name of the playlist in the sidebar once you have set up.

    TT2

Maybe you are looking for