Formula for Interactive report calculation field - Total amount per order

Hello

I use interactive report of the Apex 3.0 as a customer and want to build a formula for the scenario below.
This is the more difficult scenario to date.

There are three fields: 'NO ORDER', 'TYPE of PRODUCT","AMOUNT ".
For example,.

'NO ORDER' / 'PRODUCT TYPE' / 'AMOUNT '.

101 / license / 10000
101 / license / 5000
101 / support / 2000
101 / support / 1000

102 / License / 5000
102 / License / 2000
102 / support / 1000
102 / support / 500

I want to add two fields 'Total license' and 'Total support' calculation by command.
The result should be as follows:

'NO ORDER' / 'PRODUCT TYPE' / 'AMOUNT' / 'Licence Total' / 'Total support '.

101 / license / 10000 / 15000 / 3000
101 / license / 5000 / 15000 / 3000
101 / support / 2000 / 15000 / 3000
101 / support / 1000 / 15000 / 3000

102 / License / 5000 / 7000 / 1500
102 / License / 2000 / 7000 / 1500
102 / support / 1000 / 7000 / 1500
102 / support / 500 / 7000 / 1500

Would appreciate your help.

Thank you
Guy

You can use the fields of IR calculation for a single record. So you can not "anticipate" or sum over an order or product_type.
You have to solve in your query IR itself.
You can get (something like) that with:

select order_no
, product_type
, amount
, (select sum(amount) from test2 b where a.product_type = b.product_type and a.order_no = b.order_no) total
from test2 a 

Or more elegant and better performance wise with analytical functions:

select order_no
, product_type
, amount
, sum(amount) over (partition by order_no,product_type) total
from test2 a 

Tags: Database

Similar Questions

  • ToolTip for interactive reports

    Hi, how can I add ToolTip for interactive report column headings...


    Thank you
    Nihar Narla

    Hello

    This might help
    http://dbswh.webhop.NET/HTMLDB/f?p=blog:read:0:article:2311800346467196

    Kind regards
    Jari
    -----
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • Capture interactive report filter fields

    I have a requirement where in a user can view data, apply filters to it, and then call an Oracle API passing across the data currently visible on the report.

    If I can some how capture currently applied filters on an interactive report, I should be able to recreate the same data server before calling the API Oracle side.

    Is there a way to capture these interactive report filter field?

    Thank you
    Shikhar

    Hello

    Ok
    I don't know any Apex accumulation in the package, procedure or function you could use.
    Custom package apex_ir_query can return where clause which is related to the current user
    http://stewstools.WordPress.com/apex_ir_query-package/

    I used here as example
    http://ActioNet.homelinux.NET/HTMLDB/f?p=lspdemo:Home

    Custom paging additional IR (first name/page) and export Excel use the package on this page

    BR, Jari

  • Model of User Interface for interactive report region

    3.2 where we establish the model of user interface for interactive reports region?

    No matter what on the theme of the box I go to, the region of interactive reports shows the same. What and where do I change the model so that alternate lines use two different colors?

    There is no model for interactive reports as for a 'normal' report You need to edit the CSS and provide your own for this purpose.

    I think that most of the things are marked with the #apexir - firebug with combustion chamber is priceless. This thread may help:

    Re: changing the appearance of the interactive report.

  • Formula to calculate interactive report - String field not in position fixed

    Hello

    I use interactive report of the Apex 3.0 as a customer and want to build a formula for the scenario below.

    There is "name of role" as shown below.

    "Role name".
    =================
    FY11 RGBU OvFldMg
    FY11 ChFldIC RPBU Ind Pts
    FY11 All OvFldIC Pts
    FY11 OvFldMg All Pts Ex
    FY11 Rev OUMg All
    FY11 OUSCIC all Rev
    FY11 OUMg Rev/Mrg
    FY11 ChFldMg SysTechApps
    FY11 CpFldIC BI
    FY11 IT all
    FY11 UASRV OUSCMg
    FY11 PrFldMg HlthSc

    I want to create the calculation field' balance sheet the name of role "with the following rule.
    If the role name contains one of the strings, the value 'Role name Check' here is 'OK' else 'CHECK '.

    OV FY11
    PTS
    Rev
    Sys

    The result should be as below.
    "Role name" / "role name check.
    ==============================
    OV FY11 FldMg RGBU / OK
    FY11 ChFldIC RPBU Ind Pts / OK
    OV FY11 FldIC All Pts / OK
    OV FY11 All Pts Ex FldMg / OK
    FY11 All OUMg Rev / OK
    FY11 OUSCIC all Rev / OK
    FY11 OUMg Rev /Mrg / OK
    FY11 ChFldMg Sys TechApps / OK
    FY11 CpFldIC BI / CHECK
    FY11 IT all / CHECK
    FY11 OUSCMg UASRV / CHECK
    FY11 PrFldMg HlthSc / CHECK

    I used a simple formula "DECODE (INSTR (L, 'FY11 Ov', 1, 1), 1, 'OK', 'VIEW')'."
    But this works only if the search string is at the front of the role name.

    Would appreciate your help.

    Thank you
    Guy

    I see guys. Fortunately, there is almost always more than one way to skin a cat!

    It is possible by simply using to DECODE, but you will need to enter in nested DECODE which might be a problem depending on how the string you test against or may need to test against the future.

    If you are simply testing the existence of one of the following strings, how about you do this:

    decode(instr(L, 'FY11 Ov') + instr(L, 'Pts') + instr(L, 'Rev') + instr(L, 'Sys'), 0, 'CHECK', 'OK')
    

    He add the character positions (if found) for each of the channels of test, and if the sum is 0, this means none of the channels found test - if the sum is nothing else, it means that at least one of them has been found. It has the advantage of your being able to add strings in the future while now decent readability.

    Hope this helps,
    John

  • Create null values in the database for interactive report link column values

    Hello

    I'm pretty new to APEX and tries to create an interactive report with the form. This report examines essentially for more information for a particular employee. If the employee has any information in the table, the report presents information with a button change beside him. If there is no record in the table for this employee, a create button appears. Now when you click create, a new creation page. This page contains the employee number as a single display field with the value from the previous page. This value is displayed in the page, but it is not in the database. Create the page has view-only number and a couple of other columns. The other columns get inserted into the table with an empty number!

    Can someone please? Looks like the page keeps the value zero for the number of the employee who came during the search of the interactive report. Hope I made myself clear, being the newbie hope I haven't used any incorrect terminology.

    Thank you!
    Robet

    Without the DB column, apex will not determine which DB column the data in this field are mapped to (it would be quite impossible to guess the destination since the name of the element column).

    If you want to assign to the previous element of the page, use the default section

    return: P1_EMP_NUM

    By default the value Type: body of the PLSQL function

    and configure the attributes of source as I said before

  • Using the page as a condition for interactive report item value

    Hello. I add a button named edit in one of the interactive report column. This button should be displayed under certain conditions. Conditions are 1) If the user is Mencis and 2) value of the page called P2_DUMMY is 2. The value of P2_DUMMY is to 2 when a button is clicked. I defined a dynamic action for this. The problem is that I don't know what the condition of being added to the interactive report query.


    I tried

    CASE WHEN: APP_USER IN ('Mencis"). WHEN BOX: P10_DUMMY = 2 THEN ' < button type = "button" class = "button-default"; ">

    < span > edit </span > < / button > ' END I just get errors.

    If I just put the condition as

    CASE WHEN: APP_USER IN ('Mencis") THEN ' < button type ="button"class ="button-default "; "> < span > edit </span > < / button > ' END

    button is displayed in the report. If I add the second condition, all I get is error. I don't know how Add an element value of the page as one of the interactive report conditions. Please help me on this.

    Mencis Joe wrote:

    Hello. I add a button named edit in one of the interactive report column. This button should be displayed under certain conditions. The conditions are 1) if the user is Mencis and 2) value of the page called P2_DUMMY is 2. The value of P2_DUMMY is set to 2, when a button is clicked. I defined a dynamic action for this. The problem is that I don't know what the condition to be added to the interactive report query.

    I tried

    CASE WHEN: APP_USER IN ('Mencis"). WHEN BOX: P10_DUMMY = 2 THEN '' END I just get errors.

    If I just put the condition as

    CASE WHEN: APP_USER end of '' ('Mencis") THEN

    the button is displayed in the report. If I add the second condition, all I get is error. I don't know how to add a value to the page element as one of the interactive report conditions. Please help me on this.

    Combine the predicates in the CASE expression by using an AND condition:

    case
      when    :app_user = 'Mencis'
          and :p10_dummy = 2
      then
        ''
    end
    

    Hardcode a condition like the :app_user = 'Mencis' is likely to prove problematic for all sorts of reasons, not least including the value of APP_USER is uppercase by default, unless otherwise during authentication.

    Note that the semicolon and extra double quotes in are not valid.

  • Problem with the cascading for interactive report selection list

    Hi all.

    I'm trying to implement the solution of cascading to the tabular presentation list.

    https://Apex.Oracle.com/pls/Apex/f?p=31517:176:103661090335568:

    But instead of the form of paintings, I use interactive report. After executing the query, I get the error:

    ORA-06550: line 1, column 147: PL/SQL: ORA-00936: lack of expression ORA-06550: line 1, column 13: PL/SQL: statement ignored


    My Sql query for the report:

    select 
    apex_item.hidden(1, a."DATA_ID")DATA_ID,
    apex_item.select_list_from_query(10,
      b.WAVE_GROUP,
     'select GROUP_DISPLAY, GROUP_RETURN from dwd_wave_group',
     'onchange="f_set_casc_sel_list_item(this,f11_'||LPAD (a.DATA_ID, 4,'0')||')"',
     'YES',
     '',
     '- Select Group -',
     'f10_' || LPAD (a.DATA_ID, 4, '0'),
      NULL,
     'NO'
     )WAVE_GROUP,
    apex_item.select_list_from_query(11, b."WAVE_USER",
    'SELECT username d, '
    ||'username r FROM dwd_user where groups = '||b."WAVE_GROUP",
    '',
    'YES',
    '', 
    '- Select User -',
    'f11_' || LPAD (a.DATA_ID, 4, '0'),
     NULL,
    'NO'
    )WAVE_USER
    from "DWD_WAVE_MASTER" a, dwd_wave_assignment b
    where a.data_id = b.data_id
    and b.wave_id = 'wave_1'
    

    If I exclude the condition 2nd selection list query and change as below then everything works fine. Query does not give error on sql developer.

    Use: APEX 4.2.6 with Database 11g.

    apex_item.select_list_from_query(11, b."WAVE_USER",
    'SELECT username d, '
    ||'username r FROM dwd_user',
    '',
    'YES',
    '', 
    '- Select User -',
    'f11_' || LPAD (a.DATA_ID, 4, '0'),
     NULL,
    'NO'
    )
    

    Can someone please help!

    Thank you

    Nabila

    The nabila Islam wrote:

    I'm trying to implement the solution of cascading to the tabular presentation list.

    https://Apex.Oracle.com/pls/Apex/f?p=31517:176:103661090335568:

    But instead of the form of paintings, I use interactive report. After executing the query, I get the error:

    ORA-06550: line 1, column 147: PL/SQL: ORA-00936: lack of expression ORA-06550: line 1, column 13: PL/SQL: statement ignored

    My Sql query for the report:

    1. Select
    2. apex_item. Hidden (' 1, a. "DATA_ID DATA_ID").
    3. apex_item.select_list_from_query (10,
    4. b.WAVE_GROUP,
    5. "select GROUP_DISPLAY, GROUP_RETURN from dwd_wave_group,"
    6. "onchange =" f_set_casc_sel_list_item (this, f11_'|) LPAD (a.DATA_ID, 4, '0'). ") » ',
    7. '' YES. ''
    8. '',
    9. -Select Group «-»,
    10. "f10_" | LPAD (a.DATA_ID, 4, '0'),
    11. NULL,
    12. 'NO '.
    13. ) WAVE_GROUP,.
    14. apex_item.select_list_from_query ("11, b.") WAVE_USER,"
    15. "SELECT user name d.
    16. |' username r FROM dwd_user where group = ' | b."WAVE_GROUP."
    17. '',
    18. '' YES. ''
    19. '',
    20. "- Select user -",
    21. "f11_" | LPAD (a.DATA_ID, 4, '0'),
    22. NULL,
    23. 'NO '.
    24. ) WAVE_USER
    25. of 'DWD_WAVE_MASTER' a, b dwd_wave_assignment
    26. where a.data_id = b.data_id
    27. and b.wave_id = 'wave_1. '

    If I exclude the condition 2nd selection list query and change as below then everything works fine. Query does not give error on sql developer.

    Use: APEX 4.2.6 with Database 11g.

    1. apex_item.select_list_from_query ("11, b.") WAVE_USER,"
    2. "SELECT user name d.
    3. |' username r FROM dwd_user ",
    4. '',
    5. '' YES. ''
    6. '',
    7. "- Select user -",
    8. "f11_" | LPAD (a.DATA_ID, 4, '0'),
    9. NULL,
    10. 'NO '.
    11. )

    What is the data type of DWD_WAVE_ASSIGNMENT. WAVE_GROUP? If it is not a number, then it must be enclosed in quotes when it is used as a literal:

    apex_item.select_list_from_query(11, b."WAVE_USER",
    'SELECT username d, '
    
    ||'username r FROM dwd_user where groups = ' || dbms_assert.enquote_literal(b."WAVE_GROUP"),  
    
    '',
    'YES',
    '',
    '- Select User -',
    'f11_' || LPAD (a.DATA_ID, 4, '0'),
    NULL,
    'NO'
    )
    
  • Apex 5 - where can I configure the link column for interactive report?

    Using APEX 5 on apexea.oracle.com

    I can't work where the attributes of column layout link for an interactive report using the interface of the designer of the Page?

    Thanks in advance

    PaulP

    Paul,

    the customer_id column is defined as a hidden at the Start column, and then there is no attribute of link for this column type. You must define the type 'Link' to get the attributes. There is no attribute of link on "Plain text" either.

  • contains the clause in the search for interactive report of a clob column

    Hello

    I use the Version APEX 4.2.4.00.08

    How to use an interactive report contains the when searching a clob column so that it uses the CONTEXT index?

    Thank you

    Chandra.

    I wrote it in the SQL used for IR

    I created an APEX application that stores all our it's the HOWTO documents. (word, excel, pdf)

    ctx_doc.snippet creates the HTML code.

    select D.doc_id
      ,D.doc_filename
      ,dbms_lob.getLength( D.doc_blob ) as download
      ,decode( :P12_SEARCH, null, '-- nothing --',
             ctx_doc.snippet( 'IT_DATA.DOC_CTX_IX' -- my Oracle Text index name
                                 , D.doc_id, :P12_SEARCH )
       )
       as snippet
    from it_data.documents D
    where :P12_SEARCH is null
    or contains( D.doc_blob, :P12_SEARCH ) > 0
    

    MK

  • Using a variable db link for interactive report

    I have a requirement where users select an instance a LOV apex (link db) and data in an interactive report query based on the selected db link.

    I use a db link in a report query interactive but only if I provide the exact name of the binding. If I'm doing something link select * from foo@:P12_DBLINK it does not work.

    It seems that my only option is to use something like apex_collection.create_collection_from_query and then I can build my dynamic SQL query and use a variable for the name of dblink. Then I create just a from IRR of my collection.

    This sound correct approach like that or am I missing something?

    Any suggestions are most appreciated,

    John

    Hi John,.

    Why not create a classic report based on a function of PL/SQL returns a query.

    André

  • How to create a horizontal scroll bar for interactive report region?

    Hello

    I use APEX 4.2.5.00.08 and created interactive reports that contain many columns. However when viewing the results of the report, due to the large number of columns report/table data is outside of the region and a horizontal scroll bar appears in the window of my main browser. This seems not very good from the point of view of the customer/end user and I was wondering if it is possible the size of declare the region according to a specific size and have a scroll bar horizontal that it contains, so that users can view the rest of the report columns using the scroll instead bar rather than do what he done right now and go to the screen and having to use the main browsers horizontal scroll bar at the bottom.

    I tried on IE8, Chrome and Firefox 27.0.1 and get the same result. I tried to follow the ideas in this thread, in interactive report horizontal scroll bar, but nothing is.

    You have ideas on how I can get around this please?

    Concerning

    Hi user10248308


    Try this


    Step 1:-modify the interactive report

    Step 2:-under defination region-> header area

    put

    Step 3:-under area Defination-> foot of the region

    put


    Please come back if this is not yet resolved.

  • Query generated for interactive report

    Hi people
    I get an error in an interactive report: "ambiguously defined column.

    This cannot have been triggered by the columns selected to appear in the report. Where can I see the request generated by the report after all the changes defined by the user on the original query?
    Concerning
    CS

    Hi Chris,

    I'm not sure what version it became available, but in later versions, you can turn on debugging at the application level and then display debugging information when you run the application as a developer. This gives you information about the actual query issued by Apex.

    André

  • Dynamic title for interactive report?

    I have an interactive report where I'm passing in the interactive report filters. It's great becase it allows me to reuse a single interactive report in different ways. However, a disadvantage, in that I am running is the title of the report. I would really like to be able to change the title of the report based on the filters that I. Is this possible? If the title of the report can be dynamic?

    Thank you

    Andrew Watson

    Change the interactive report region.
    In the title, enter & P1_SOME_PAGE_ITEM.
    When p1_some_page_item is a hidden... item store the title at this point and your will become dyanamic

    Kind regards
    Shijesh

  • Custom UI for interactive reports

    Hello

    Can anyone help me regarding the custom user interface of interactive reports?

    I want to have the color of line replacing in the grid of the interactive report and instead of using existing apex themes I want to have my own custom theme with my choice of colors and settings, can someone tell me in this regard?

    To a certain extent, I tried to achieve in java script code bt tht is nt a value.



    Thank you

    The HTML of the Page header is a great way to try this out. Or a link to a file css on your Web server and modify the css in there.
    If you use Firefox with Firebug you can clearly see the css that is applied to each element.
    You can use jQuery to apply (one) another css-entry to a TR or TD, or other. But the first step is to override the settings. Then, you can change the standard IR into something like this.
    You can also check here or here.

Maybe you are looking for

  • Update 2.2 for milestone motorola Israel

    Hi, what's up? I Israel and a month ago I buy the motorola milestone a8533 (its look like the droid phone) my version of android and its 2.1, 2.2 or 2.3 update will arrive in Israel sometimes [if so, when]? and why does take a lot of time to update?

  • How to determine the color of a pixel on any given point on the screen?

    Does anyone know if it is possible to get the value of hexadecimal color of a pixel on the screen? And if yes how can I do this? I'm developing an application which can detect the color of an object in another (open) window and based on some steps. A

  • Do not update Windows (error code 8007005)

    Windows do not update. I get the error code 8007005. Eventually Windows is damaged? I have recently reinstalled Windows 7 upgrade (from Vista) when I did it I got an error (no real product Windows) but it is, and product code has been accepted. This

  • My cdrom/dvdrom is not connected to the code 19 windows I think

    I need help please

  • Monitor display settings are too big

    I went to the settings display and changed the settings of the monitor.  The display is now so important that I can't see my Start button, taskbar and icons on the desktop.  I can open the Explorer (because I accidentally found this icon) but if I ha