calculate the interactive report function

Hi all the 1.



I need assistance with an interactive report, that I am producing. What I'm trying to do is use to calculate the interactive report function and add the number of a week (for example week 26) and add it to the estimated number of the week



The problem I have is that they are on different lines



The table below shows that I work with.



Week no. | County forecast | Real number*.

___26__ | ___0___ | ___128231___

___26__ | ___180916___ | ___0___

___27__ | ___0___ | ___164666___

___27__ | ___180916___ | ___0___

___28__ | ___0___ | ___169302___

___28__ | ___180916___ | ___0___

___29__ | ___0___ | ___159857___

___29__ | ___180916___ | ___0___

___30__ | ___0___ | ___162210___

___30__ | ___180916___ | ___0___

___31__ | ___0___ | ___152471___

___31__ | ___180916___ | ___0___





Any help would be welcome :)



Thanks in advance

-N.S.N.O.

Hello

You could always wrap your initial statement in an external selection that does the aggregation:

select WEEK_NO, NVL(SUM(FORECAST_COUNT),0) FORECAST_COUNT, NVL(SUM(ACTUAL_COUNT),0) ACTUAL_COUNT FROM (
select ROUND(TO_NUMBER(TO_CHAR(TO_DATE(rpad(con_add_td_hr, 10),'yyyy-mm-dd'),'ddd')-2)/7)+1 WEEK_NO, 0 FORECAST_COUNT, sum(cons_total) ACTUAL_COUNT
from corcon01_hour_totals
where db_name='CSAHEPA' and substr(con_add_td_hr,1,4)='2008' and CON_ADD_USER_ID not like '%LDL%'
group by ROUND(TO_NUMBER(TO_CHAR(TO_DATE(rpad(con_add_td_hr, 10),'yyyy-mm-dd'),'ddd')-2)/7)+1
UNION
select week_no, sum(manual_entry_cons)+sum(citedi_cons) FORECAST_COUNT, 0 ACTUAL_COUNT
from concount_forecast_data
where db_name ='CSAHEPA' and year ='2008'
group by week_no
)
GROUP BY WEEK_NO

There are probably other ways to handle this and you would have to make sure that the select statements internal consistent column names, so the outer statement can use.

Andy

Tags: Database

Similar Questions

  • How can I rearrange the columns in the not displayed section of the interactive report.

    Hello

    My interactive report contains 185 columns and requieres users to build its reports with some columns, but he gets lost between this amount of columns, it would be easier if the columns in the do not display the interactive report section would be automatically sorted, is it possible?

    Thank you very much

    Hi Eva,

    A solution would be to order the column names in alphabetical order. You can create a dynamic JavaScript action to manage the sort.

    The shuttle of the attribute IR "Select columns" have the ID "apexir_SHUTTLE_LEFT" or hidden columns and 'apexir_SHUTTLE_RIGHT' to the displayed columns.

    The function that you create might look like:

    var options = $('select#apexir_SHUTTLE_LEFT option');
    var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value }; }).get();
    arr.sort(function(o1, o2) { return o1.t > o2.t ? 1 : o1.t < o2.t ? -1 : 0; });
    options.each(function(i, o) {
      o.value = arr[i].v;
      $(o).text(arr[i].t);
    });
    
    var options = $('select#apexir_SHUTTLE_RIGHT option');
    var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value }; }).get();
    arr.sort(function(o1, o2) { return o1.t > o2.t ? 1 : o1.t < o2.t ? -1 : 0; });
    options.each(function(i, o) {
      o.value = arr[i].v;
      $(o).text(arr[i].t);
    });
    

    You need to find the right timing for dynamic action to run, I suppose the click on the button "Select columns" would do the trick.

    Kind regards

    Vincent

    http://vincentdeelen.blogspot.com

  • Colon in link with the interactive report

    Hello

    I have two interactive reports which are connected by link column on one of the columns, the problem is that some of the values contains a colon

    for example, the value is ABC: 123 , but the linked report a value = 'ABC' is generated in the filter

    So I can see there are many sons and based on those I can escape the string using APEX_UTIL. URL_ENCODE so now I get Value = 'ABC % 3 A 123' in the filter that is still nothing.

    So I think on the interactive report, I need to somehow convert the return value on the page so the interactive report can deal with it, but I don't see how to do this and I can not find all threads that deal with these.

    I don't want to use an element on the page to filter the report the report is sometimes access directly and it would act/look different to other pages where we have it but don't have the problem that these values have no settlers. I can't remove the colon as they come from an external source.

    We use the apex 4.1

    Any ideas?

    WOWL wrote:

    This isn't the real value, but I think that its close enough for users, if I were to create a dynamic of any idea action that she could do as my knowledge of dynamic action is limited.

    Create dynamic Action to replace "_" with ":" when the IR is updated:

    When

    Event: After refresh
    Selection type: Region
    Region: IR / / whatever your area

    Real Actions

    Action: Run the JavaScript Code
    Fire on Page load: Yes

    // Change 'Colon Val' in selector to heading of colon-containing column
    $("#apexir_CONTROL_PANEL_COMPLETE .fielddata a:contains('Colon Val like')")
      .each(function () {
        $(this).text($(this).text().replace('_', ':'));
      }
    );
    
  • SEARCH IN THE INTERACTIVE REPORT

    I have two pages. I need, thanks to a button, driving some information for another page. But I need to press information for the search field of the interactive report.
    I think the name is apexir_SEARCH
    How I refer to the search field?
    Help me please...

  • A page element to store the string search say P100_SEARCH_ITEM.
  • Affect this element through the use of IE URL that article redirect to URL to this page
  • Add onload JS code that sets the IR field with the value of the page element.

    $s ('apexir_SEARCH', $v ('P100_SEARCH_ITEM'))

  • In addition, add an event handler to set the page element when the search field is changed too

    $('#apexir_REPORT #apexir_SEARCH').change(function(){
      $s('P100_SEARCH_ITEM',$v('apexir_SEARCH'))
    });
    
  • Apex 4.0 how use the interactive report filter feature?

    Hi all
    Sorry for the nub question, but if there is a way to create and save 'report' with the filter condition using a function?
    What I want to do is to create an interactive table called TASK report.
    Table has two columns I want to use for filtering:
    FDate - DATE - date
    TDate - DATE - to date
    Then, I need to create multiple saved reports:
    last week the tasks = where FDate between sysdate - 7 AND sysdate...
    last month tasks = where FDate between ADD_MONTH(sysdate,-1) AND sysdate...
    but,
    Interactive report filter does not accept sysdate or calls to functions ADD_MONTH.
    Is there an easy way to configure this feature?
    TIA
    Thomas

    Sorry for the double post...

    Published by: thomaso on August 6, 2010 12:04

    Hi Thomas,

    Take a look at the type of filter 'Row' in the interactive reports filter dialog box. This allows more dynamic filters, such as those involving SYSDATE or ADD_MONTHS calls. See also the next thread for some more details on this:

    Re: Interactive report - line conditional highlighting date function

    It will be useful.

    Anthony.

  • Add Javascript to the content of the interactive report

    Hello

    I need to add some Javscript to an interactive report so that this event fires whenever the content of the report is reloaded. I found how this is done for a standard report, but not for the interactive report. JavaScript placed in the header of the region or the footer only runs on the loading of the page and not when the region of the report is updated, such as after a search, or when you apply a filter. Does anyone have an idea on how this is done? What is the function Javascript is called is charging?

    Thank you

    Rick Fanning

    Hello

    This might help you
    http://Apex.Oracle.com/pls/OTN/f?p=24382:38:

    You can find out how to see the source code here
    Implement jQuery modal form

    BR, Jari

  • With regard to the interactive report

    I've created the interactive report, then I remove the function of adding/deleting/changing inside, because I put my function all in plsql package. I could handle the add and delete function changed, however, is totally giving me a headache. I create an anonymous PL/SQL (process) block when the click on the button Delete, then delete the button will trigger the javascript confirmation. and then in my anonymous PL/SQL block, I key in

    myPLSQLpakacage.myDeleteProcedure(:p1_tableid);

    When I run the system, the process got through, and the "success" message. However, registration is still there stay. I check my point, process and compare to that of the sample «Document Library 0.92» I just found out they got from the additional hidden (P75_RETURN), after the process, it will go to the Page (and P75_RETURN) which I don't understand.

    Please help on this point, why my plsql did not, I try just to run the query in the anonymous pl/sql block as

    declare
    Identification number;
    Start
    ID: = v('p1_tableid');
    delete from the table where tableId = id;
    commit;
    end;

    but it's still not. So what's the problem with that?

    Hello

    BEGIN/END; It must be for all PL/SQL code.

    However, your problem is actually on this piece:

    0.01:... Process "reset page": CLEAR_CACHE_FOR_PAGES (AFTER_SUBMIT) 52
    0.01: removal of application cache "103" page: 52

    You have a "reset page" process that runs immediately before your process - this clears the value of P52_TABLEID. This process is usually provided automatically when you create a form by using a wizard. Delete it or the Never value condition.

    Andy

  • Customize the Action menu in the interactive report

    To change the word 'Action' in the menu of the interactive report.

    Apex 4, we had the 'Image of the Action menu' option, but the Apex 5 this option disappeared.

    This isn't in known issues in the Apex 5!

    Someone knows how to set an image or other text to the menu Action interactive report?

    Anderson.Ferreira wrote:

    To change the word 'Action' in the menu of the interactive report.

    Apex 4, we had the 'Image of the Action menu' option, but the Apex 5 this option disappeared.

    This isn't in known issues in the Apex 5!

    Someone knows how to set an image or other text to the menu Action interactive report?

    Why do you need to change?

    Follow the instructions in 'Translating Messages used internally by Oracle Application Express' to create a custom text for the message of the APEXIR_ACTIONS system. Available for translation/customization internal messages are listed in these tables.

  • Initial value for the interactive report

    I have an interactive report that has a where clause condition clause: where =(:P50_employeeName) used.

    (: P50_employeeName) is a a list of selection without value null. When the page loads the selection list displays the value employee1, but the interactive report is empty. It's not until I select another value within the selection list becoems active report. How I can so when page loading the interactive report shows instead of being blank? I can't the values of hard employee-coding as each user can see only the user in their Department.

    Hello

    Since I don't know all your table structure, it was just a quick sampling of the approach.

    I guess that your LOV would have the correct where clause to control its content, and you can add additional conditions to the IR where clause as well.

    Here is an example of one of my IR where clauses

    the case when: P200_DEPARTMENT = 0 then 1

    When: P200_DEPARTMENT <> 0 and: P200_CREW = 0 and: P200_DEPARTMENT = c.crewdeptkey, 1

    When: P200_DEPARTMENT <> 0 and: P200_CREW | " <> 0 and: P200_CREW = c.crewkey, 1

    end if 0 = 1

    Kind regards
    Brad

  • Filter column position of the interactive report

    Hi all!

    First of all, sorry my English.

    I have a problem with filters standart on the interactive report column heading. Version 4.0.2 APEX. It is interactive report based on the view. Nothing unusual - behavior and the default templates. I have also the region of filter on the page, and after user-press "apply" button my package variables to session state of filter. View used these values. It is worked and filtered interactive report. But when I try also to use the filters on the heading of the column that is nothing past. I have try the column type: report Standart column and display text. I have try the Filter Type column: by default based on the Type of column and the list defined by the use of... Contain. Nothing, as no filter exists at all. Filtering with worked as usual action buttons. I think that this problem in a SEPARATE implicit in this filter. I know that there are quantitative limitation of DISTINCT values with column header filter, but I have nothing in the filter. And even I have type the value and press ENTER, nothing happened. Columns with Date type is fine, but String and number does not.

    There is no work around? Thank you.

    Solved within "parameterized" view, remove and replace with SELECT with params.

  • Contains no column 5 added to the interactive report apex

    Hi, I added a column in the query to the interactive report region and it does not appear in the designer of the Page, as it is not available when running in the list of columns through the action of the report menu.

    In the 4 apex when the query was changed directly a message was generated with the details of the new or modified columns, but the Apex 5 when I change the query and save, nothing happens.

    How to view the new column?

    Thank you.

    carlosjch wrote:

    Thanks fac586, I already tried to use view of the component, when I modify the query the new column is added, a message appears: area update.   No details of the new column appears in the message.  The result is the same, the column is not available after that.

    What happens if you create another IR with the new query?

  • Filter delete automatically the interactive report

    Hello world

    We are seeing the question in the filter APEX. I applied the action filter-> filter. the filter is applied as expected. then we are navigate current page to another new page. When we return to the old filter page, we are not able to get the filter.

    For example: we have the "amount" column I applied a quantity of filter > filter 0 on page 1, then page 2 accessing we. When we return to page 1 we are not able to find the amount > 0 filter

    Let me know how to solve this problem.

    Kind regards

    Sushant

    Hi LnTInfotech,

    LnTInfotech wrote:

    Hi Sunil,

    Thanks for your information, but in my case, we do not save the default (primary) report. We have to got to page 1 to page 2 with any filter and return back to page 1 need to show the same filter.

    Kind regards

    Sushant

    Are you compensation/reactivate the interactive link (button, breadcrumb) report? Reference: a link to the interactive reports

    As clearing (CIR) /resetting (IRB) interactive report leads to clear the filters applied to the interactive report in the session active.

    Note: Filters / other attributes of the action menu applied to the interactive report are specific session, user may choose to save it as a saved report interactive and developer can choose to save as the main report.

    For more information about interactive reports see the Oracle APEX documentation and tutorials available on Oracle Learning Library like this:

    http://www.Oracle.com/WebFolder/technetwork/tutorials/OBE/DB/Apex/R40/apexirr/apexirradv/apexirradv_ll.htm

    I hope this helps!

    Kind regards

    Kiran

  • When I try to change the interactive report columns, then triggers the error: "unable to change column attributes. "ORA-01403: no data found. Pls tell me why?

    When I try to change the interactive report columns, then triggers the error: "unable to change column attributes. "ORA-01403: no data found. Pls tell me why?

    You use listener EA3 ADR?

  • Calculations in APEX 4.2 on the interactive report and the update form

    Hello

    I know that people have asked similar questions, but I was not able to do this work. I'm doing some fairly simple math (addition, multiplication) in an application. I have 2 fields (VALUE_A, VALUE_B). I can get the addition and multiplication work in the interactive report, but I also need that it works correctly in the form of update. I also need update form to work dynamically so that if the values are changed, the correction calculated response is shown immediately on the update form and then reflected in the interactive report. I tried the dynamic action, with and without javascript without result. Any help would be appreciated.

    Request Express 4.2.6.00.03

    model application:

    https://Apex.Oracle.com/pls/Apex/f?p=82162:

    username: guest

    password: Peanut123

    Thank you

    Rachel

    ADD dynamic action

    After refresh of region

    Set value

    ELEMENT the VALUE to change

    check the fire on the load

    To source, use expression JavaScript

    If ($v ("P2_TEST_1")! = null & $v ("P2_TEST_2")! = null)

    {

    parseInt ($v ("P2_TEST_1")) + parseInt ($v ("P2_TEST_2"));

    }

    ElseIf ($v ("P2_TEST_1")! = null & $v ("P2_TEST_2") == null)

    {

    parseInt ($v ("P2_TEST_1"));

    }

    ElseIf ($v ("P2_TEST_1") == null & $v ("P2_TEST_2")! = null)

    {

    parseInt ($v ("P2_TEST_2"));

    }

    on the other

    { 0; }

    That add another dynamic action on change POINT P2_TEST_1 and set even with the same expression JavaScrit action. but NOT fire on the load
    Do the same for the ARTICLE P2_TEST_2

    And the same for A times B but change + to *.

    Here, I did samples for you with this code.

    https://apex.Oracle.com/pls/apex/f?p=83519 demo/demo

  • How to add the action button for each column in the interactive report

    Hi all

    I'm new in APEX, so pls forgive my question, if it's simple, but I am struggling with this problem for days now. I have interactive report and you want to add button in each row. What I want to do with this button is the following:

    1. to execute some stored procedure in need of that particular line item values

    2. returns a (id)

    3. go in another page in the application by passing the value out of the procedure (id).

    and I'm not find the way to do it. I tried now means:

    1. If I add the link of the column, so I can refer to the value of the current row, I don't know how to call the stored procedure and perform actions of rest I need

    2. If I add the button to the region, I do not know how to reference the values in column of a particular line of the interactive report...

    and I'm stuck...

    I just forms and global report and probably still think the "wrong" way .

    Any help would be appreciated!

    Thank you!!!


    user3253917 wrote:

    Please update your forum profile with a real handle instead of 'user3253917 '.

    I request of the company: there is a customer who always orders the same standard product orders (always order the same products, fair amount is different). I want to make it simple for the user: instead of retyping the command (master and few records details every time yet) I want to copy selected command (copy of the master record and record details) so that the user will only change date order (in master record) and amount fields in record details).

    So, in order to give him:

    1. the user must be able to choose the order in which I would copy (at page 4), select it,

    2. I need to make PL/SQL procedure to insert the new master record (order) and a few record details (order_items) (copy of the order/order_items chosen in step 1)

    3. navigate the user to page 29, where the master account at stage 2 insterted appears, so that the user can change the date and quantities.

    Any solution will be highly appreciated! Thank you very much!!!

    In simple terms:

    1. Add a link to column "Command copies" in the report on page 4, which sets the COPY request and passes the order ID on page 29.
    2. On page 29, create a process before header, sequenced to be the first process executed and conditional on REQUEST be EXEMPLARY, which creates a new order as a copy of the order with the ID from page 4 and returns the ID of the new order in the PK command ID of 29 page element.

Maybe you are looking for