Interactive Report - Aggregate Calculations

How can I get a variance or stddev calculation in an interactive report? This should function exactly the same as a sum or average aggregation. As I don't see a way to do it with the interface, and at the very least, I am hoping someone can help with sql that would provide a variance calulation on the pertaining generated interactive report.
Thanks,

Well Rana I had thought about that, but the problem is that the calculation becomes a line item and not an aggregate calculation. And since I am performing other aggregate computations on the table through the interactive reporting tools already, I would like to stay with the same path. I am hoping I will not be forced to take that path.
Thanks,

Similar Messages

  • Interactive Report with Calculated Aggregates - possible?

    I'm search for a possibility to create an aggregated column that is simply a computed value of two other aggregates.
    Example
    This how the basis data can look like
    Orderitem  | price |  no.
    A          | 100   | 3    
    B          | 10    | 1     The interactive report allows then to create a calculated column "total price" (price*no.) and some aggregates.
    Orderitem  | price |  no. | total price
    A          | 100   | 3     |  300
    B          | 10    | 1     | 10
               |       | sum: 4 | sum: 310I now want to create an additional aggregate line for column price holding the AVERAGE price.
    If I add such a column the result is (100+10) / 2 = 55 which is wrong from a business perspective.
    The correct value should be: 310/4 = 77.5.
    And the result would look like this
    Orderitem  | price     |  no. | total price
    A          | 100       | 3     |  300
    B          | 10        | 1     | 10
               | avg: 77.5 | sum: 4 | sum: 310Is is somehow possible to create this using only the interactive reports features? Without reprogramming regions or the base SQL.
    I can do it using pure SQL solutions. However the end users don't have the knowledge how to create such complicated queries.
    Edited by: Sven W. on Jul 3, 2009 3:22 PM
    Edited by: Sven W. on Jul 3, 2009 5:02 PM

    Btw. I mentioned that I can do it in pure SQL. Let me share this solution. Problem is that it is not interactive anymore.
    SQL> set timing off;
    SQL> with testdata as (select 'A' Orderitem, 100 price, 3 num from dual
      2                    UNION ALL select 'B' Orderitem, 10 price, 1 num from dual)
      3  select Orderitem,
      4         Price,
      5         num
      6  from testdata;
    O      PRICE        NUM
    A        100          3
    B         10          1
    SQL>
    SQL> with testdata as (select 'A' Orderitem, 100 price, 3 num from dual
      2                    UNION ALL select 'B' Orderitem, 10 price, 1 num from dual)
      3  select DECODE(GROUPING(orderitem), 1, 'All',orderitem) orderitem,
      4         DECODE(GROUPING(price), 1, sum(Price * num)/sum(num) ,price) price,
      5         sum(num) num,
      6         sum(Price * num) total_price
      7  from testdata
      8  group by grouping sets ((orderitem, price, num),()) ;
    ORD      PRICE        NUM TOTAL_PRICE
    A          100          3         300
    B           10          1          10
    All       77.5          4         310
    SQL> I'll guess for the real interactive feature we'll need to wait for some future Apex version.
    Edited by: Sven W. on Aug 19, 2009 2:07 PM

  • Interactive Report - aggregate with hide - bug or feature?

    We are in the process of converting existing reports to Interactive Reports (IR), and adding a bunch of new ones. We ran into a roadblock when using IR with aggregates. To
    reproduce, I created a test table with region, state, county, city and population columns. I created an interactive report, CONTROL BREAK on "Region", aggregate (SUM) on
    population. The result looked like this.
    <p>
    <b>Result #1:</b>
    <p>
    Region: West
    ************<b>
    State  County         City            Population</b>
    CA     Orange County  Irvine          100
    CA     Orange County  Orange          200
    CA     Los Angeles    Hollywood       300
    CA     Los Angeles    Universal City  400<b>
                          Sum           1,000</b><p>
    When I clicked on City column, and chose to hide it, I expected the IR to resummarize the result to look like this:
    <p>
    <b>Result #2:</b>
    <p>
    Region: West
    ************<b>
    State  County         Population</b>
    CA     Orange County  300
    CA     Los Angeles    700
           Sum          1,000</b><p>
    But what I saw was this:
    <p>
    <b>Result #3:</b>
    <p>
    Region: West
    ************<b>
    State  County         Population</b>
    CA     Orange County  100
    CA     Orange County  200
    CA     Los Angeles    300
    CA     Los Angeles    400<b>
           Sum          1,000</b><p>
    The data in the above result #3 is not presented the in way it should be for the users to comprehend.
    <p>
    In the non-interactive version, we display checkboxes for the users to show and hide the columns. If the column "City" is set by the user to "Hide", then we use the
    condition on the column to hide the City column from the report, and use the query "SELECT ..., CASE WHEN :P10_SHOW_CITY = 'YES' THEN city ELSE NULL END As city, SUM
    (population) FROM .. " to summarize the data. This displays results like the one shown in Result #2.
    <p>
    1. Shouldn't IR re-summarize the data to display results like I have shown in Result #2 when a column is hidden? We are able to achieve this with non-interactive version. Is this a
    bug in IR?
    <p>
    2. Is there a way to get interactive report to display results like the way I have shown in Result #2?
    <p>
    3. Is there a way to retrieve the columns that are set to "HIDE" in IR so that we can modify our SQL to resummarize?
    <p>
    <b><u>Script to reproduce:</u></b>
    <p>
    Create table test_ir(
        region varchar2(50),
        state  varchar2(50),
        county varchar2(50),
        City   varchar2(50),
        population number(4))
    insert into test_ir(region, state, county, city, population) values
    ('West', 'CA', 'Orange County', 'Irvine', 100)
    insert into test_ir(region, state, county, city, population) values
    ('West', 'CA', 'Orange County', 'Orange', 200)
    insert into test_ir(region, state, county, city, population) values
    ('West', 'CA', 'Los Angeles', 'Hollywood', 300)
    insert into test_ir(region, state, county, city, population) values
    ('West', 'CA', 'Los Angeles', 'Universal City', 400)
    select region, state, county, city, population from test_ir<br>
    Thanks.<br>
    <br>
    Ravi

    Hi Ravi,
    When you add a control break, we do not re-generate the query to do group by. We just do control breaks. In the current version of APEX, to achieve what you are trying to see, you need to create an Interactive report with group by clause. If you want to use a dynamic query, the solution I suggest will not work.
    The good news is in APEX 4.0, we are working to include group by view to an Interactive Report. This will let you select group by columns and aggregate functions to get the Result #2 you are trying to get.
    If you wish to see how this works, we will be able to show if you come to APEXposed 2008, October 29 - 30, at Chicago O'Hare Wyndham.
    Christina

  • Help with Aggregate on Interactive Report

    I have a field that is a number but I need to convert to show as a percentage (i.e. 17.4%) in the interactive report. At the same time I need to be able to do an Aggregate on this field so I know it needs to stay a numeric and I can't convert in the SQL. Is there a way to use the number format mask on the column to add the percentage or another way that will allow me to still perform aggregates?
    Version: Application Express 3.2.1.00.12
    Thanks for your help.
    Chris

    Anyone have any suggestions?
    Thanks.

  • How to use an Aggregate in a Computation on an Interactive Report?

    version 4.0.2.00.07
    Hello,
    I'm trying to create a computation on an Interactive Report from the Actions menu to compute a percentage.
    I have two Status columns, one for open and one for closed. I have to count the number of open and count the number of closed and then divide the two.
    I created an aggregate, count, on the open status and closed status, but how to use them in the computation? There's no 'count' in the Function list in the Compute box.
    I was hoping that those aggregated columns would be displayed in the Compute sub-menu on the Actions button but they don't appear to be.
    Can someone help me with this?
    Thanks,
    Joe

    Maybe an alternative would be to put this logic into the select.
    select u.object_name,
           u.object_type,
           count(case when u.object_type = 'TABLE' then 1 end) over () count_tables,
           count(case when u.object_type = 'VIEW' then 1 end) over () count_views
    from user_objects u;This would count the number of tables and views in the data dictionary. And it is returned as a column value.

  • Calculation on Interactive reporting

    I have no knowledge on interactive reporting, all Italy IR consultant are on holiday and I need an answer concerning solution feasibility as soon as possible, so if you can help me I will be very gratefull to you
    On a planning application using note and cell text interactive reporting could:
    1.     Asking some parameters to user: elements to be extract and information about the kind of average calculation that has to be done in the report and so on
    2.     Using these parameters to extract data from essbase
    3.     Calculate the type of average requested by users
    4.     In the same reports execute a query on planning to show cell text related to displayed element (This I know it is possible)
    release is 9.3 and it is not possible to do an upgrade (customer has on of the biggest HFM implementation in the word, so it would be impossible to upgrading EPm suite just only for a planning's needs)
    Thanks
    paola

    Here is location of the IR Studio Guide.
    http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/ir_user.pdf
    Brian Chow

  • Interactive Report Need total of aggregate (sums) where break format used

    I have an interactive report that uses break formatting. When I do an aggregate (sum) for the Quantity Column I get the sums for each campaign_id (used for the break format column). This is great. However, at the bottom of the report I need a grand total for all campaign ids (a sum of the sums) in a new row at the bottom of the report. Is this possible?
    I can't paste a screenshot here to show but her is a simple one column example - I can't make the columns stay lined up but I think you can see what I need.
    {code
    Campaign Hand Addressed (break format column)
    Quantity
    100
    200
    Sum:300
    Campaign Travel Check
    Quantity
    100
    500
    Sum:600
    Sum:900 This is row I need to add
    Oracle 11GR2
    APEX 3.2.1

    This works when I run it in SQL Developer. Now I enter this for my report query in APEX and I get the "not a GROUP BY expression.
    {code
    SELECT *
    FROM t3_mail_piece t
    WHERE t.week_id = 11
    GROUP BY ROLLUP(t.campaign_id, t.market_id)
    ORDER BY t.campaign_id
    , SUM(t.quantity);
    What is different?

  • Interactive Report - How to display Aggregate values in first row

    Hi,
    I have an interactive report in which I have included aggregate for count.
    But the count doesn't show until I navigate to the last page of the report.
    Any idea how to display all the aggregate values on the top(in first row), so that the user doesn't have to click next to see these values.
    Also when I downloaded the report the aggregate columns are not exported into csv. Any thoughts on this highly appreciated.
    Thanks,
    Raj.

    Any help on this guys ?

  • When using a interactive report I go to aggregate and no column are there

    When using a interactive report I go to aggregate, sum and go to choose my columns but I have no column there what am I missing

    Just a guess, but have you checked to make sure there's a numeric column in your report (and not, for example, a varchar column that happens to have numbers)?
    -David

  • Aggregate function usage in interactive reports

    Dear All,
    I am trying to use the aggregate option in interactive reports , i am not getting any outputs. Can any one please show any examples from your reports ? or give me some idea to get the functionality work done for my reports.
    Thanks in advance.
    Regards
    Dhanush.R

    Dear All,
    I am trying to use the aggregate option in interactive reports , i am not getting any outputs. Can any one please show any examples from your reports ? or give me some idea to get the functionality work done for my reports.
    Thanks in advance.
    Regards
    Dhanush.R

  • Interactive report - order column by other column values

    Hi Oracle experts,
    could you please advise how to order column A by values of column B in Interactive report ?
    When clicking on header of "Countries" column in order to sort it acs/desc I would like to order it by values of column "Sort_order" which stores values from 1 to 100.
    The goal is to order "Countries" not alphabetically, but according to values of "Sort_order" column.
    Any ideas?
    Thanks in advance for your help.
    Best regards,
    Konrad

    962622 wrote:
    Hi Oracle experts,Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "962622".
    When you have a problem you'll get a faster, more effective response by providing as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    could you please advise how to order column A by values of column B in Interactive report ?
    When clicking on header of "Countries" column in order to sort it acs/desc I would like to order it by values of column "Sort_order" which stores values from 1 to 100.
    The goal is to order "Countries" not alphabetically, but according to values of "Sort_order" column.
    Any ideas?I'm not an expert on Interactive Reports, so there may be a less brute force method using the built-in features, but here's an approach that's worked in the past.
    Modify the query to generate the column as:
    '<!-- '|| to_char(sort_order, '009') || ' -->' || countryi.e. prefix the country name with an HTML comment containing the required ordinal number. This won't be visible in the report, but will be considered when sorting in SQL.
    In the IR Column Attributes set the column's Display Text As property to Standard Report Column so APEX won't escape the HTML tags.
    This method has side effects: some IR filters won't work; aggregate calculations can't be applied to the column; and report exports contain the HTML rather than the expected value.
    Edited by: fac586 on 02-Oct-2012 13:28
    From APEX 4.2 IR columns have support for HTML Expressions, so Re: Report formatting/sorting issue using a hidden column and HTML Expression should be used, as it's purely declarative and provides better separation of concerns. (Still a problem on report exports though. Whilst the sort column can be suppressed using a condition, the hidden column can't be "unhidden" to replace it.)

  • Interactive report and font colours

    Apex : current version
    I have an interactive report that displays details from Table 1.
    I need to display the data is different colours. How do I do that?
    Eg: name of employees in green their email id in red etc etc.
    Can I do this ? If yes, please tell me how do I do this?
    Thanks in advance.

    LKSwetha wrote:
    Hi Joe,
    The colour varies in fields based on what is displayed.
    For instance, I have the main employees table and a skills table with values Job A, Job B ,Job C etc.
    Different employees are skilled for different jobs so emp1 can have job A and job b while emp2 can have job D and job A etc
    The interactive report actually pulls data from a view I created based on the emp table and skill table
    emp1 job A Job B
    emp2 job D job A
    I want to display all Job A(displayed in report) in green colour and Job B in red and so on....Then why didn't you say so originally?
    Eg: name of employees in green their email id in red etc etc.No mention of skills, jobs or conditions.
    I want to know of we can do this and if yes how do I achieve it.Yes you can do this. If you had searched the forum before posting you'd have found out how to do it more than 24 hours ago.
    The real question is whether you should be doing this at all. Why do you think actually need/want to do this? It doesn't seem to provide any real usability benefit, and appear very likely to violate Web Content Accessibility Guidelines.
    But if you must...
    As interactive reports lack the HTML Expression feature of standard reports, the standard way to do this unfortunately requires violating the separation of concerns and generating structural (a <tt>span</tt> element) and presentational (an in-line style sheet) aspects in the query:
    select
    ⋮        
           , case
               when sk.skill = 'Job A'
               then
                 '<!-- ' || sk.skill || ' --><span style="color: green;">' || sk.skill || '</span>'
               when sk.skill = 'Job B'
               then
                 '<!-- ' || sk.skill || ' --><span style="color: red;">' || sk.skill || '</span>'
               ⋮
             end job1
    ⋮For columns to be properly sortable, the leading edge of the column must be an HTML comment that provides the required sort order using character semantics.
    The Display As column attribute for such columns must be set to Standard Report Column.
    This method has side effects: some IR filters won't work; aggregate calculations can't be applied to the column; and report exports contain the HTML rather than the expected value.
    Other approaches involve using Dynamic Actions/jQuery/JavaScript.
    However, if there are more than a few jobs/skills involved, or this information is volatile and subject to change then this method breaks down. To start with, there are only 17 named CSS colours, so if your minimal CSS knowledge doesn't extend to specifying colours in another way and you've more than 16 jobs then they can't all have a unique colour (white/silver/gray will be invisible on some IR backgrounds). It's also difficult/tedious to maintain this type of hard coding if the data changes frequently. How many jobs/skills are there?
    For more than 3 or 4 jobs a better approach would be to store the CSS colours or classes in a column in the skills table, and just select it with the job name:
    select
    ⋮        
           , '<!-- ' || sk.skill || ' --><span style="color: ' || sk.color || ';">' || sk.skill || '</span>' job1
           , '<!-- ' || sk.skill || ' --><span style="color: ' || sk.color || ';">' || sk.skill || '</span>' job2

    I am not so familiar with CSS so am bit confused while trying previous steps given by fac586What is confusing (other than posting a question different to the one you actually want answered)?
    You will be able to achieve very little in APEX if you are unfamiliar with the web technologies it uses. Spend some time on the tutorials here: start with HTML, then XHTML, CSS, Javascript and the HTML DOM, and now HTML5.
    Can you give me any simpler steps to achieve this? No, that is the simplest way to implement what was originally asked for.
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form) and if so, whether the tabular form is declarative—using only report attributes and a wizard generated MRU process—or manual—using apex_item calls in the query and custom processing—or some hybrid approach.)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    Read the FAQ and forum sticky threads if you haven't done so already.

  • Default Style Column Breaking in an Interactive report

    In a normal SQL report there are two types of column break formatting:
    1) Default Breaking Format e.g.
    aaa 123
            456
    bbb 789
            123
    2) Repeat Headings e.g.
    aaa
    123
    456
    bbb
    789
    123
    Interactive reports seem to only implement Repeat Headings . Is it possible to break columns in an IR report using "Default Breaking Format"? If so how?
    thanks
    PaulP

    JB wrote:
    Is it possible to add conditional column formatting in an Interactive Report in Apex 4.1? I've found numerous examples for older versions using the standard (classic) report, but I haven't found any with the new Interactive Report. Is this possible? and if so, can someone point me in the direction of some documentation or examples?
    Oracle Application Express (APEX)
    As interactive reports lack the HTML Expression feature of standard reports, the simple way to do this unfortunately requires violating the separation of concerns and generating structural (a <tt>span</tt> element) and presentational (an in-line style sheet) aspects in the query:
    select
    ⋮        
           , case
               when trunc(calling_date,'DD') =  trunc(sysdate,'DD')
               then
                 '<!-- ' || to_char(calling_date, 'YYYYMMDD') || ' --><span style="color: #3399FF;">' || to_char(calling_date) || '</span>'
               else
                 '<!-- ' || to_char(calling_date, 'YYYYMMDD') || ' --><span>' || to_char(calling_date) || '</span>'
             end calling_date
    ⋮For number/date columns to be properly sortable, the leading edge of the column must be an HTML comment that provides the required sort order using character semantics, as shown here.
    The Display As column attribute for such columns must be set to Standard Report Column.
    This method has side effects: some IR filters won't work; aggregate calculations can't be applied to the column; and report exports contain the HTML rather than the expected value.
    Other approaches involve using Dynamic Actions/jQuery/JavaScript, or using the built-in highlight as suggested above, then saving the highlighted report as the default.

  • Conditional Column Formatting in an Interactive Report?

    Is it possible to add conditional column formatting in an Interactive Report in Apex 4.1? I've found numerous examples for older versions using the standard (classic) report, but I haven't found any with the new Interactive Report. Is this possible? and if so, can someone point me in the direction of some documentation or examples?
    I simply want to change the color of the text depending on whether a column has a value (eg. Error or Problem).
    Thanks

    JB wrote:
    Is it possible to add conditional column formatting in an Interactive Report in Apex 4.1? I've found numerous examples for older versions using the standard (classic) report, but I haven't found any with the new Interactive Report. Is this possible? and if so, can someone point me in the direction of some documentation or examples?
    Oracle Application Express (APEX)
    As interactive reports lack the HTML Expression feature of standard reports, the simple way to do this unfortunately requires violating the separation of concerns and generating structural (a <tt>span</tt> element) and presentational (an in-line style sheet) aspects in the query:
    select
    ⋮        
           , case
               when trunc(calling_date,'DD') =  trunc(sysdate,'DD')
               then
                 '<!-- ' || to_char(calling_date, 'YYYYMMDD') || ' --><span style="color: #3399FF;">' || to_char(calling_date) || '</span>'
               else
                 '<!-- ' || to_char(calling_date, 'YYYYMMDD') || ' --><span>' || to_char(calling_date) || '</span>'
             end calling_date
    ⋮For number/date columns to be properly sortable, the leading edge of the column must be an HTML comment that provides the required sort order using character semantics, as shown here.
    The Display As column attribute for such columns must be set to Standard Report Column.
    This method has side effects: some IR filters won't work; aggregate calculations can't be applied to the column; and report exports contain the HTML rather than the expected value.
    Other approaches involve using Dynamic Actions/jQuery/JavaScript, or using the built-in highlight as suggested above, then saving the highlighted report as the default.

  • Check box in interactive report is literal string not a check box ???

    I'm trying to create a check box in an interactive report using the APEX_ITEM.CHECKBOX function.
    My select statement is :
    select     "CUTOVER_TASKS"."ID" as "ID",
         "CUTOVER_TASKS"."START_DATE" as "START_DATE",
         "CUTOVER_TASKS"."END_DATE" as "END_DATE",
         "CUTOVER_TASKS"."DURATION" as "DURATION",
         "CUTOVER_TASKS"."EFFORT" as "EFFORT",
         APEX_ITEM.CHECKBOX(1,COMPLETED, 1) as "COMPLETED",
         "CUTOVER_TASKS"."ASSIGNED" as "ASSIGNED",
         "CUTOVER_TASKS"."CONSTRAINT_START" as "CONSTRAINT_START",
         "CUTOVER_TASKS"."CONSTRAINT_END" as "CONSTRAINT_END",
         "CUTOVER_TASKS"."DEPENDENCIES" as "DEPENDENCIES",
         "CUTOVER_TASKS"."NOTES" as "NOTES",
         "CUTOVER_TASKS"."PRIORITY" as "PRIORITY",
         "CUTOVER_TASKS"."ORGANIZATION" as "ORGANIZATION",
         "CUTOVER_TASKS"."TASK" as "TASK"
    from     "CUTOVER_TASKS" "CUTOVER_TASKS"
    This produces an interactive report with the COMPLETED column contents "<input type="checkbox" name="f01" value="" 1 />"
    The same sql in a regular report works properly and creates the check box.
    Is there something else required for a check box in an interactive report ?
    Using : Application Express 3.2.0.00.27

    Go to Report Attributes and change the display type to "Standard Report Column" (instead of "Display as Text, escape special characters")
    Go to Column Attributes for that column and change the List Of Values to None and uncheck all the column's interactive features (sort, aggregate, compute, etc)

Maybe you are looking for