Interactive Report Compute Field Creation Computation Formula

I'm trying to create a compute field in Interactive Report in APEX 3.
There are two fields: 'Plan Type' and 'Product Type'.
I want to create Compute Field - 'My Check'
Condition is as follows:
If 'Plan Type' field value begins with 'FY11 AA' and 'Product Type' field value ends with 'ABC' then 'My Check' field value should be 'CHECK' else 'OK'.
'Plan Type'-----------'Product Type'----------'My Check'
FY11 AA123---------123ABC-------------------CHECK
FY11 BB123---------123KKK--------------------OK
FY11 CC123---------123ZZZ--------------------OK
Would appreciate if you can write for me a computation formula for the case above.
Thanks,
Guy

Hi Jari,
Thanks for your formula.
When I tried that, I got error as below.
Actual formula entered:
case when BH = 'Y' then
case when SUBSTR(T,1,7) = 'FY11 OU' then
case when SUBSTR(AL,-3) = 'REC' then
'CHECK'
else 'OK' end
else 'OK' end
else 'OK' end
Error message:
Invalid computation expression. then case

Similar Messages

  • Capturing Interactive Report Filter Fields

    I've a requirement where in a user can view data, apply filters to it, and then invoke an Oracle API by passing in the data set 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 on the server side before calling the Oracle API.
    Is there a way to capture these Filter field out of the Interactive report?
    Thanks,
    Shikhar

    Thanks again Jari.
    I compiled Stew's package and setup a call like this:
    DECLARE
       v_variable   VARCHAR2 (5000);
    BEGIN
           v_variable := apex_ir_query.IR_QUERY_WHERE (app_id_in => 125,
                                        page_id_in => 2,
                                        session_id_in => 1058992121588043,
                                        base_report_id_in => 6902307847490674);
       DBMS_OUTPUT.PUT_LINE ('Query: ' || v_variable);
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.PUT_LINE ('Exception :' || SQLERRM);
    END;But this didn't return anything. Did some digging and ran the SQL below:
       SELECT * FROM apex_application_page_ir_cond cond where application_id = 125Which revealed interactive report id values different from the ones returned by $v('apexir_REPORT_ID'); $v('apexir_REPORT_ID') returns 6902307847490674 but in the table its 7.76121620735057E15 (My Apex version is 3.2).
    I'm not going to pursue it further, as I've decided to implement custom filtering functionality using ape_util.ir_query package. Thanks for your valuable help with this issue. Closing the question.
    Edited by: user4368002 on Jul 16, 2010 2:00 PM

  • Interactive report search field with autocomplete , is it possible ?

    Hi all,
    As you know the APEX provides an in-built search for interactive reports . I would like to know if its possible to add autocomplete feature to this ?
    Thanks & regards
    Umer

    Its nor working for me .
    1) I created an textfiled item- P2_REPORT_SEARCH
    2) added an interadctive report with the source as
    SELECT * FROM (
    select     "WSR"."ID" as "ID",
    "WSR"."USER_ID" as "USER_ID",
    "WSR"."FROM_DATE" as "FROM_DATE",
    "WSR"."TO_DATE" as "TO_DATE",
    "WSR"."ACTIVITIES" as "ACTIVITIES",
    "WSR"."PROJECT" as "PROJECT",
    'delete' from
    "WSR" "WSR"
    where
    ("WSR"."USER_ID" = NVL(v('APP_USER'),USER) OR NVL(v('APP_USER'),USER) = 'ADMIN' ) AND (
    "WSR"."FROM_DATE"=to_char(sysdate+ (2-to_char(sysdate,'D')))
    where (
    instr(upper("USER_ID"),upper(nvl(:P2_REPORT_SEARCH,"USER_ID"))) > 0 or
    instr(upper("ACTIVITIES"),upper(nvl(:P2_REPORT_SEARCH,"ACTIVITIES"))) > 0
    instr(upper("PROJECT"),upper(nvl(:P2_REPORT_SEARCH,"PROJECT"))) > 0
    )3) added the folowing query to html header ,
    <script>
    apex.jQuery('#report_' + pId + '_catch').trigger('apexbeforerefresh', pId);
    var l_URL =
    'p='+$v('pFlowId')+':'+$v('pFlowStepId')+':'+$v('pInstance')+':FLOW_PPR_OUTPUT_R'+pId+'_';
    if (pRefreshMode) {
    if (pRefreshMode === 'current'){
    // do nothing to url here
    } else if (pRefreshMode === 'reset') {
    l_URL += 'reset_R_' + pId;
    } else {
    if (!!pSort) {
    l_URL += pSort+'::RP&fsp_region_id='+pId;
    } else {
    l_URL +=
    'pg_R_'+pId+':NO&pg_max_rows='+pMax+'&pg_min_row='+pMin+'&pg_rows_fetched='+pFetched;
    l_URL += ':NO::P2_REPORT_SEARCH:' + $('#P2_REPORT_SEARCH').val();
    var lRequest = new apex.ajax.url(l_URL,
    function(pResponse){
    var l_s = pResponse.readyState;
    var l_Id = lRequest.report_id;
    if(l_s == 1){
    }else if(l_s == 2||l_s == 3){
    }else if(l_s == 4){
    var lTemp = $u_js_temp_drop();
    apex.jQuery('#report_'+l_Id+'_catch').attr('id', 'report_'+l_Id+'_catch_old');
    apex.jQuery(lTemp).html(pResponse.responseText);
    apex.jQuery('#report_'+l_Id+'_catch_old').replaceWith(apex.jQuery('#report_'+l_Id+'_catch'));
    apex.jQuery(lTemp).empty();
    apex.jQuery('#report_' + pId + '_catch').trigger('apexafterrefresh', pId);
    }else{return false;}
    lRequest.report_id = pId;
    lRequest._get();
    return;
    </script>
    4) a dynamic action:
    >
    Name: Instant Search
    Event: Key Release
    Items: P2_REPORT_SEARCH
    Condition: No Condition
    Action: Refresh
    Fire when event result is: True
    Selection type: Region
    Region: WSR(Interactive reoprt region)5) When I enter the query in P2_REPORT_SEARCH , no change happens in the result set of IR
    Edited by: Nice1 on May 16, 2012 1:12 AM

  • Interactive Report - Compute problem

    When I try and to anything with the "Compute" option of an interactive report I get:
    Invalid computation expression. ORA-00942: table or view does not exist
    Anyone know why? or which table may be missing?

    Reproduced this on apex.oracle.com
    http://apex.oracle.com/pls/otn/f?p=37327
    Login with Demo, no password and navigate to the Projects page.
    here is the query that drives the interactive report:
    select     "PROJECT"."PROJECT_ID" as "PROJECT_ID",
         "PROJECT"."PROJECT_NAME" as "PROJECT_NAME",
         "PROJECT"."PROJECT_MGR" as "PROJECT_MGR",
         "PROJECT"."DEV_DATE" as "DEV_DATE",
         "PROJECT"."CIE_DATE" as "CIE_DATE",
         "PROJECT"."QA_DATE" as "QA_DATE",
         "PROJECT"."PROD_DATE" as "PROD_DATE",
         "FDIC_DEPARTMENT"."DEPARTMENT_CODE" as "DEPARTMENT_CODE"
    from     "#OWNER#"."PROJECT" "PROJECT",
         "#OWNER#"."FDIC_DEPARTMENT" "FDIC_DEPARTMENT"
    where "PROJECT"."FDIC_DEPARTMENT_ID" ="FDIC_DEPARTMENT"."DEPARTMENT_ID" (+)

  • Interactive Report Formatting

    I created an interactive report and used the compute functionality to add some data computations. I want to format them (i.e. center the data, wrap the text in the header, etc.). I tried to use html to wrap the text in the header, but it didn't recognize it. Is there any way to center the data, wrap text, etc. on these computations?
    Edited by: Bob Sacamano on Jul 22, 2010 4:52 PM
    Edited by: Bob Sacamano on Jul 22, 2010 4:52 PM

    hmmm....no replies yet. does this mean it can't be done???

  • Add line break in name of an interactive report computed field

    I have a computed field in an IRR and need the name of this field to be broken into 2 lines. In regular columns I can add "br" right in the column attributes but if I use that in the computed field name, the HTML "br" actually shows up in the field name. How can I do this?

    Here is a threa dealing with a nowrap issue for an IRR, try making the nowrap setting in the css a wrap and see what happens..
    Re: Interactive Report - fields wrapping
    Thank you,
    Tony Miller
    Webster, TX

  • Decode formula for Interactive Compute field

    Hi,
    Need help for decode formula for Interactive Compute field.
    What is wrong with the formula below?
    What I want is...
    If BH field value is 'Y' then get T field value else 'OK'
    If T field value does not begin with 'FY11 OU%' then get AL field value else 'OK'
    If AL field value ends with 'REC' then 'CHECK' else 'OK'
    DECODE(SUBSTR(decode(SUBSTR(decode(BH,'Y',T,'OK'),1,7),not like 'FY11 OU%',AL,'OK'),-3),'REC','CHECK','OK')
    I get error message: Invalid computation expression. not
    Would you please suggest me a correct formula?
    FYI, I'm using Apex 3.0 which does not support CASE WHEN THEN END.
    Thanks,
    Guy

    DECODE(BH || SUBSTR(T,1,7) || SUBSTR(AL,-3),'YFY11 OUREC','OK','CHECK')
    I guess the above code will mark 'YFY11 PRREC' as 'CHECK' because it is different from 'YFY11 OUREC'.
    But according to my second case criteria, it should be marked as 'OK' because...
    BH = 'Y'
    T does not begin with 'FY11 OU'
    AL ends with 'REC'.
    Currently I'm running filtering with your formula. But it is taking too long time. I guess there are too many lines matching with this criteria.
    Thanks,
    Guy

  • HTML in computation in Interactive Report

    Hi,
    I am trying to output some html in an Apex (v4.1.0.00.32) interactive report in a computation field but it just outputs the html
    How can I put something like a br tag or a non breaking space {noformat} {noformat}
    eg
    'AllTo: ' ||  J || '<br>Dev: ' ||  KOk, code I want is in the image below
    thanks
    Robert
    Edited by: bobonacus on Mar 1, 2013 10:19 AM ... Ironically this forum uses the html!!

    bobonacus wrote:
    Hi,
    I am trying to output some html in an Apex (v4.1.0.00.32) interactive report in a computation field but it just outputs the html
    How can I put something like a br tag or a non breaking space {noformat} {noformat}
    eg
    'AllTo: ' ||  J || '<br>Dev: ' ||  KOk, code I want is in the image below
    thanks
    Robert
    Edited by: bobonacus on Mar 1, 2013 10:19 AM ... Ironically this forum uses the html!!I do not understand what you are saying. Can you re-explain the problem with different words?

  • Compute function on interactive report

    Hi Every 1,
    I need some help with an interactive report i am trying to produce. What i am trying to do is use to compute function of an interactive report and add the actual count from a week (e.g. week 26) and add it to the forecast count of that week
    The problem that i have is that they are on different rows
    The table below shows that i am working with.
    Week No|Forecast Count|Actual Count*
    ____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.

    Is that the only way that this could be done?
    I have tried to get the values on the same row but it has proved very very difficult.
    The query i use to get the data is this:
    select ROUND(TO_NUMBER(TO_CHAR(TO_DATE(rpad(con_add_td_hr, 10),'yyyy-mm-dd'),'ddd')-2)/7)+1 "Week No", 0, 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 Data", 0
    from concount_forecast_data
    where db_name ='CSAHEPA' and year ='2008'
    group by week_no
    The problem that i have is that the 2 tables are not relate and do not have a matching table structure. For the actual count table i have to generate the week number using a data/hour column.
    If you have any suggestions i would be very grateful.
    Thanks
    -N.S.N.O.
    Edited by: N.S.N.O. on Sep 16, 2008 2:21 AM

  • Interactive Report - Compute columns

    Hi,
    Interactive report query is storing in a apex view - apex_application_page_ir.
    Like, if compute columns added in runtime, APEX is making a new query with compute columns. I want to know in which APEX view is having this query:
    I created a Interactive report (APEX 3.2.0) for the following query:
    select
    "EMPNO",
    "ENAME",
    "JOB",
    "MGR",
    "HIREDATE",
    "SAL",
    "COMM",
    "DEPTNO"
    from "EMP"
    In the run time, I added a compute column , now the query is as follows:
    select
    ROWID as apxws_row_pk,
    "EMPNO",
    "ENAME",
    "JOB",
    "MGR",
    "HIREDATE",
    "SAL",
    "COMM",
    "DEPTNO",
    "SAL" *10/100 "APXWS_CC_001",
    count(*) over () as apxws_row_cnt
    from (
    select * from (
    select
    "EMPNO",
    "ENAME",
    "JOB",
    "MGR",
    "HIREDATE",
    "SAL",
    "COMM",
    "DEPTNO"
    from "EMP"
    ) r
    ) r where rownum <= to_number(:APXWS_MAX_ROW_CNT)
    order by ROWID
    Regards
    Mohan

    it is not the sql query its all about the report_columns in apex_application_page_ir
    in case anyone landed in this page

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

  • How to add a computed field to a reports

    I have a report where I would like to add a column that is the sequence of the row. It is not the rownum in the db, but I want it to be a row number for what is returned.
    So, if I return 10 records, I would like a column to contain 1 through 10 to depict the row number.
    I do not want to have this number in the table or view.
    Is it possible to add a computed field to a report like this?
    If so, how?
    Thanks - Jim

    The SQL function rownum should suffice if the report is not too complicated, as this returns the number of the row rather than the database row ie.
    select empno,ename,rownum
    from emp
    add some clauses each time and you should see that each row is always numbered 1 to n.
    However, if you introduce the HTMLDB column sort functionality into the report then it would appear that it is the result set that is sorted rather than a new query being issued.
    Hope this is of help.

  • The symbol '=' is missing in interactive report compute option's keypad

    Hi Friends,
    I am having an interactive report. I am trying to give a compute option like CASE WHEN A = 10 THEN B + C ELSE B
    END . All other sysmbols except *=* is found in the key pad. But if we put '=' symbol manually it is working fine. Is
    there any option to show the *=* symbol in the key pad itself?
    Thanks
    TJ

    Hi,
    There is no option to add it
    Br, Jari

  • APEX Interactive Report Compute Case with multiple conditions to highlight

    My ultimate is to highligt a row in an interactive report based on two conditions. I didn't see a way to use the highligt feature with two conditions. So I thought I would try to create a computation based on the two conditions. Then use that result for the highligting. Though I don't seem to be a be able to use multiple conditions in my computation Case statement. Is there a different syntax?
    Here is what I have:
    Case
      When  C = 'Open' and  I > 15 Then 'True'
      Else 'False'
    End The error I get is: Invalid computation expression. and
    Application Express 4.0.2.00.07
    Thanks!
    Edited by: cjmartin on Jan 10, 2012 10:57 AM

    I'm surprised no one responded to this. What I did to resolve this issue was create a nested case statement. I don't think this was a good solution, but I can't find anyone else giving input. I know I can create another computational column in the select statement for the report, but the 'Interactive Report' part is where this should be. I want my clients to calculate what they want. Kind of hard when you can not use an 'and' for a range criteria.

  • Own function in computation (Interactive Report)

    Hello,
    I have checked package WWV_FLOW_WORKSHEET_DIALOGUE (it's wrapped, so I've checked it only slightly) and table WWV_FLOW_WORKSHEET_COMPUTATION and found that those two objects are responsible for functions we can see/use at Compute panel of Interactive Report. I need to add my own function to computation but it's not possible. When I write MY_FUNCTION(A) in text box and try to apply then I receive message: "Invalid computation expression. MY_FUNCTION".
    Is any way to add own function to be seen by Compute option in Interactive Report?
    It's important that I don't want to use MY_FUNCTION in query defined in Region Source!
    Thanks in advance,
    Regards

    Hi, just stumbled over your question and I happened to have the same problem.
    It appears not to be possible to use your own functions although it would definitely be very nice.
    However, I found a solution, but given that I already had my knuckles rapped once for mentioning them-who-must-not-be-named (anything starting with "WWV..." really), I am not going to post it here.
    If you are still interested (and if you didn't fix it already for yourself), drop me a personal mail and I'll get back to you.
    Needless to say, you should think long and hard before you make any modification in any WWV_ object and then decide that you shouldn't.
    Regards,
    Iulian

Maybe you are looking for