Calculation of a total of 2 different columns in different regions.

Hi all
Can someone give me a hint on how to refer to the 2 different columns in different regions, I need calculate a total by adding these. My idea is to create another region and hoping to write sql code to calculate the total, but do not know how to refer to these two columns?

Any help please?

Thank you
Naushad.

Report columns that are not of the fields (as in a report updated (in form)) can not be referenced. I think your only likely choice is to repeat the code SQL for two reports in the 3rd region out of all non-relevant columns and then to summarize these in SQL itself.

Tags: Database

Similar Questions

  • Calculating totals in a different region...

    Salvation;
    I have a performance problem:

    Inside of a page, I have 2 regions. In one of them, there is an interactive report that lists the invoices (sales and returns). The second area a an HTML element that i put in it totals. I did it using text fields and get their values by running queries to their source. It worked, but as you can seerunning many queries (4 in this scenario), it is slow. Y at - it an easier way to calculate these totals using numbers from the report above.

    Thanks in advance for your help

    Concerning
    Fatih

    Fatih,

    You could write a single process of PL/SQL and populate all the Total items with a single SELECT statement.

    brgds,
    Peter

    -----
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • Query to get the difference between 2 totals of 2 different queries

    I wanted to know if it is possible to get the difference between 2 totals of 2 different queries. Let me explain with an example:

    1 application ofst - sum (homepass) Select table 1

    2th query: select sum (homepass) from table2

    Is it possible to display the difference as -

    Select sum (homepass) in table 1 - sum (homepass) from table2

    I know that the above query would give syntax error, but is there a better way or something to get the above done task from a single query.


    Hopefully, my question is clear.


    Please get back with the answer to my query.


    Concerning

    You can always do something like

    SELECT a.cnt - b.cnt
    FROM (SELECT sum(homepass) cnt from table1) a,
          (SELECT sum(homepass) cnt from table2) b
    

    I'd be somewhat dubious, although on a data model that had two tables with the same name of the column where it really made sense to subtract one amount from each other.  This would strongly imply that there should be a single table with an additional column TYPE eventually.

    Justin

  • Any method to create a total SUM of a column whose values based on LAG?

    I have a question here, and the challenge is to explain my situation well. I am developing a workbook that shows by project and month, the cost of this period and the change in the cost of the previous period. I want a total SUM on the columns of this period cost and cost change in prerequisite Mth. So what I want to do resembles something like this--

    Months of project cost this time Chg prior Mth cost

    ABCDE Jan $50,000 NULL (since no line before)
    ABCDE February $ $75,000 25 000
    Mar $60,000 ABCDE - 15 000
    ------------------------ ----------------------------------------------
    Total of $ $185,000 10 000

    I do the Chg of cost of prior Mth as a new calculation and use the formula insert model process to use the model of the difference f (x) to create my calculation. Who is working just great. If you look at the underlying code for this new section, you can see the LAG function used in the calculation of this value. I'm late to a single line, as you can see in the example above.

    I can create a new total and take a NAP in the cost column this time and get the right answer (the $185 000).

    The problem that I am running is that I get nothing when I try to summarize my prior Mth column cost Chg. The result is just empty (prints the text of the total, but no amount).

    My thought is that the NULL row in this column was to spoil the AMOUNT of work. So, I created a new calculation and said CASES WHERE prior cost Chg of Mth IS NULL THEN 0.00 ELSE cost Chg of Mth prior. So I get a new column with the same numbers, except for the first line, where I now have a 0 instead of NULL. Then, I created a new total (SUM function) on this new column. Heck. Same result with regard to the other column. I do not receive an amount.

    Everybody run on an issue to try to sum a column of numbers being calculated from a SHIFT function in discoverer? Any suggestions on how I could get a SUM to calculate correctly to this column cost Chg prior Mth? Or have I met one of those irritating questions "cannot manage in discoverer?

    Of course I can export the workbook results run to Excel and create the calculation in there, and that works fine.

    John Dickey

    Hi John
    Thanks for the question and great information. That really helped. I love this kind of questions. They make me think :-)

    Just a thought but have you tried to change the AMOUNT for a sum of CELL?

    The SUM will try to assess the LAG on the total that would be invalid as, at least in theory, the SUM of the CELL must literally add the values.

    Best wishes
    Michael

  • How to batch, fusion of the 3 different images? I use molten and the total of 240 different images.

    How to batch, fusion of the 3 different images? I use molten and the total of 240 different images.
    is there any script for it?

    like photoshop, batch processing is unable to identify 3 different images and merge these three images. Instead, it performs the action on a single image.

    Thank you

    under the direction

    // 2015, use it at your own risk;
    #target photoshop
    var theFolder = Folder.selectDialog ("select folder");
    if (theFolder) {
    ////////////////////////////////////
    var theFolders = theFolder.getFiles(getFolders);
    for (var a = 0; a < theFolders.length; a++) {
    var theFiles = Folder(theFolders[a]).getFiles(/\.(jpg|tif|eps|psd)$/i);
    ////////////////////////////////////
    // open first image;
    theFile = app.open(theFiles[0]);
    var basename = theFile.name.match(/(.*)\.[^\.]+$/)[1];
    // place other files;
    for (var m = 1; m < theFiles.length; m++) {
    placeScaleRotateFile (theFiles[m], 0, 0, 100, 100, 0, false);
    // set to screen;
    theFile.activeLayer.blendMode = BlendMode.SCREEN
    };
    // save as psd;
    psdOpts = new PhotoshopSaveOptions();
    psdOpts.embedColorProfile = true;
    psdOpts.alphaChannels = true;
    psdOpts.layers = true;
    psdOpts.spotColors = true;
    theFile.saveAs((new File(theFolder+'/'+basename+".psd")),psdOpts,false);
    };
    };
    ////////////////////////////////////
    ////// place //////
    function placeScaleRotateFile (file, xOffset, yOffset, theXScale, theYScale, theAngle, linked) {
    // =======================================================
    var idPlc = charIDToTypeID( "Plc " );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        desc5.putPath( idnull, new File( file ) );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc6 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc5.putObject( idOfst, idOfst, desc6 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idWdth, idPrc, theYScale );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idHght, idPrc, theXScale );
        var idAngl = charIDToTypeID( "Angl" );
        var idAng = charIDToTypeID( "#Ang" );
        desc5.putUnitDouble( idAngl, idAng,theAngle );
    if (linked == true) {
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc5.putBoolean( idLnkd, true );
      };
    executeAction( idPlc, desc5, DialogModes.NO );
    // get layerid;
    var ref = new ActionReference();
    ref.putProperty (stringIDToTypeID ("property"), stringIDToTypeID ("layerID"));
    ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var layerDesc = executeActionGet(ref);
    var layerID = layerDesc.getInteger (stringIDToTypeID ("layerID"));
    // =======================================================
    return [app.activeDocument.activeLayer, layerID];
    };
    ////// get folders //////
    function getFolders (theObj) {
    if (theObj.constructor == Folder) {return true}
    };
    
  • Difference between different models (sold in different regions) of the iPhone 7

    I'm traveling to the Japan, and it turns out that my phone broke. So, I plan to buy iPhone 7. But I noticed that there are different models according to the countries or regions. According to Apple customer service, it has to do with different bands of LTE in different regions. But exactly the same bands that WE supported the Japanese model (which is completely separate from all other) / version of the EU with the exception of it's CDMA.  She would work very well after my return to Europe (Germany)? Where can I buy non-CDMA, GSM version for the Japan as well.

    Here is the link showing the differences between the various models of iPhone 7.

    You have a question?

  • Text prediction with different regional settings in Windows 7 - shows disabled in Korean

    prediction of title: original text with different regional settings in Windows 7

    Hello

    I have English as the main language and Korean as a language second.  Text prediction works very well with this configuration; However, if I change the regional settings (non-Unicode) in Korean, text prediction is disabled.

    There is no work around for this?

    Thank you.

    Michael

    Hello

    • Text prediction is only available in English, French, Italian, German and Spanish. To enable text prediction in a specific language, you must first install additional language files for that language. For more information, see install or change a display language.

    • Text prediction is not included in Windows 7 Home Basic Edition.

  • When a Blu - Ray burning are all selected by default different regions?

    When a Blu - Ray burning are all selected by default different regions?

    By selecting a region in Encore for Bluray has no effect, then Yes.

  • Private network between hosts in different regions

    Dear guys,

    I have just asked me if it would be possible that 2 hosts in different regions (EU-NA) can communicate on a virtual private network over the Wan.

    How to perform I thought to arrive at:

    -import the host NA in a cluster in the EU vcenter

    -create a tmp DVS and attach 2 guests to the DVS

    -create a private VLAN GP and configure 2 virtual machines with this PG = > they just have to communicate with each other, this is just a test

    The question I have is this: given that the 2 hosts are in different regions, traffic of 2 VMs would go across the WAN using the DVS even?

    Thanks in advance.

    Daniele

    I thought on it and it is not possible, DVS and a dummy network, we have L2 and we have no tools for the encapsulation of L2 to L3, I have no NSX.

    I will give points me

    Daniele

  • My brother-in-law works for your company and he bought the creative cloud for me and gave me a redemption code to use to download. However, I live in the Japan and her suitor that he bought in a different region and I can't download it. What sho

    My brother-in-law works for Adobe and it bought creative cloud for me and he sent me the redemption code to download. I live in the Japan and its telling me that it was bought in a different region. What should I do to redeem here. I tried to change my region in the United States and I don't think it works.

    Hi Trey,

    You may need to create an Adobe ID to use the code, for more information, please visit this link: redemption code help

    Once you have created a new account with the region of the United States, please follow this link to redeem your code: https://redeem.licenses.adobe.com/getserial

    Kind regards
    Rahul

  • Display 1 button in 2 different regions

    Hi all

    I have a requirement. I need to show a particular button in 2 regions different say that X and Y.

    How can I do that. I can only have a regions for a button. How do the 2 regions.

    Thank you

    HI Tatiana,

    Yes I understand your condition. We cannot use the static ID.

    My method should work.

    You must create two buttons for 2 different regions.
    and use the applications button in your SRM process, as mentioned above.

    So if administrators log in then click on the button in region X, it will call the SRM process.
    If end users, login and click on the button in region Y, he'll also call the SRM process.

    You don't need two processes.

    Sreenithi

  • Show the different regions by clicking on the entries in the list

    Hello world

    I have a page with several regions, but I want to only show one at a time; I want you to show with a checklist. So, whenever I click on an entry in the list, I want to see a specific region and if a click on a second entry in the list, I want to see another. It must be without submitting the page (for different reasons).

    An example of I want to do is when you change an element in the APEX; You can see a list of buttons 'Show all', 'name', 'Displayed', 'Label', 'Settings', etc. Function of the key, you click, you will see a different region.

    I think it is a very sleek and elegant way to show a lot of information to users, if only I could apply it... any ideas? :)

    Thank you
    Elena.

    Elena.MTC wrote:

    I have a page with several regions, but I want to only show one at a time; I want you to show with a checklist. So, whenever I click on an entry in the list, I want to see a specific region and if a click on a second entry in the list, I want to see another. It must be without submitting the page (for different reasons).

    An example of I want to do is when you change an element in the APEX; You can see a list of buttons 'Show all', 'name', 'Displayed', 'Label', 'Settings', etc. Function of the key, you click, you will see a different region.

    I think it is a very sleek and elegant way to show a lot of information to users, if only I could apply it... any ideas? :)

    4.1 the best way to proceed is to use the integrated Region Selector display.

    After you have created the RDS, customization is necessary to display only one region at a time.

    1 hide the RDS "Show all" link (and change the second link to resemble the first) by adding this stylesheet in the header HTML page:

    
    

    2. by default, all regions will be displayed when the page is loaded. Hide others using dynamic Action to simulate a click on the first link in the region of the RDS and the first region:
    H4. When

    Event: Page load
    H4. Real Action

    Action: Run the JavaScript Code
    Fire on loading the Page: No.
    Code:

    $('.apex-rds-container li:first-child+li a').click()
    

    See this article to view region selector sticky if you want the value of the visible area to be preserved if the page is refreshed.

  • How to make shape even alignments of element on two different regions

    Hello

    I have two different areas on the same page as the second is below the first. The two regions have some form elements like text field, select list etc. However the alignment of elements on these two regions are not the same. In different regions, it lines up just the input fields based on the maximum length of the label in the region only, so it creates two different vertical alignments by region. How have the same alignment for elements of entry in all regions?

    (I want to download the screenshot of the page but there is no provision in this forum to do).

    Thanks in advance.

    Natarajan

    The basic approach is to set the width of the point labels using a built-in CSS style sheet in the Header HTMLpage:

    
    

    If you want to limit it to the elements in specific regions, then give these regions region static ID (for example, region-1) for use as CSS selectors:

    
    
  • 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

  • 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
    ;

Maybe you are looking for

  • Windows 10 USB on MacPro Quad mid-2010

    Hi guys, we have a MacPro running El Capitan [early 2013] on which we want to install Windows 10. Windows 10 is on a USB key. Bootcamp requires a drive. How to overcome this impasse? We have an ISO downloaded ~ 4GB of Microsoft but it doesn't seem to

  • How can I connect 7.1 speakers to a s5xt ("speakers 7.1 capable" when he has only 3 audio ports?)

    I chose the s5 of HP on the competition series because it was clearly labelled on the site that the s5z and s5xt are capable of 7.1.  However, when receiving it, I find that it has 3 rear audio ports.  I can't easily connect on that until the cable i

  • While with PXI-5122 digitizer loop counter

    Hello world I am a beginner of products NOR. Currently I use the PXI-5122, 2014 Labview for the ultrasonic signals. I have a problem when you count the number of signals using an external trigger (by a function generator) source. When I trigger the d

  • Norton Internet Security trial version stopped working and asked me to uninstall and reinstall

    Norton Internet Security has stopped working and asked me to uninstall and reinstall. I uninstalled, now I can't seem to find a way to reinstall it. Either way, it was the evaluation version of the security of the software that came with it since I b

  • Display fonts motorcycle G_Boxed

    Hi all I am owner of a motorcycle G 16 GB mobile. I have a problem in which the fonts in the mobile suddenly gets displayed as small boxes when I suddenly close an app and reopen it. Everyone knows about this problem? The new update will rectify this