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

Tags: Database

Similar Questions

  • Decode the formula to calculate interactive field

    Hello

    Need help to decode formula to calculate interactive field.

    What is the problem with the formula below?
    What I want is...
    If the BH field value is 'Y' then get the field value T to another 'OK '.
    If the value of the T field does not begin with 'FY11 OR %' then get value in field of another 'OK '.
    If the value of field AL ends with "REC" then 'CHECK' otherwise 'OK '.

    DECODE (SUBSTR (decode (SUBSTR (decode (BH, 'Y', T, 'OK'), 1, 7), not as 'FY11 OR %', AL, 'OK'),-3), 'REC', 'CHECK', 'OK')

    I get the error message: invalid calculation expression. not

    Could you please suggest me a correct formula?

    FYI, I use Apex 3.0 which does not support the CASE WHEN THEN END.

    Thank you
    Guy

    Hello

    It is slow when you use functions like this in query

    I don't know how you like it as one more example of

    DECODE(DECODE(SUBSTR(T,1,7),'FY11 OU','OK','NOK') || DECODE(BH || SUBSTR(AL,-3),'YREC','OK','NOK'),'NOKOK','OK','CHECK')
    

    And I'm sure it's still slower

    Kind regards
    Jari

  • ORA-20987: APEX - interactive report region does not exist in the application

    ORA-20987: APEX - interactive report region does not exist in the application

    I'm trying to get the query of an international registration (interactive report) on a specific page in my application.

    The code I am using is thesi:

    create or replace function get_report_query (nPage_id number)

    return varchar2

    as

    l_report apex_ir.t_report;

    l_query varchar2 (32767).

    l_list varchar2 (32767).

    number of nRegion_id;

    number of nIR_id;

    OWA.vc_arr nm;

    VL owa.vc_arr;

    BEGIN

    SELECT region_id

    IN nRegion_id

    Of apex_application_page_regions

    WHERE application_name = "E-BRIL.

    AND page_id = nPage_id

    AND source_type = "interactive report";

    nIR_id: =.

    apex_ir.get_last_viewed_report_id (p_page_id = > nPage_id,)

    p_region_id = > nRegion_id);

    NM (1): = "DUMMY_JUST_TO_SET_UP_OWA_UTIL";

    VL (1): = 'WHATEVER ';

    OWA.init_cgi_env (nm.count, nm, vl);

    l_report: = APEX_IR. () GET_REPORT

    p_page_id = > nPage_id,

    p_region_id = > nRegion_id,

    p_report_id = > 0);

    l_query: = l_report.sql_query;

    because me in 1.l_report.binds.count

    loop

    l_list: = l_list | i||'. '|| l_report. Binds (i) .name | » ='|| l_report. Binds (i) .value;

    end loop;

    Return l_query;

    end;

    /

    I want to get the query of the IR on my page 3. And I run;

    get_report_query (3)

    That's what I get:

    ORA-20987: APEX - interactive report region does not exist in application, page 3 and 1278226325207011749 region. -Contact your administrator of the application.

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 630

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 911

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 33

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 55

    ORA-06512: at "EBR_OWNER. GET_REPORT_QUERY', line 19

    The regio_id seems ok, because when I ask this region_id of apex_application_page_regions, id 1278226325207011749 is returned.

    Page 3 is also correct.

    I tried to follow Denes Kubicek his blog (Denes Kubicek ApEx BLOG: interactive report query is).

    What I'm doing wrong here?

    We use the Apex 4.2.

    Thanks in advance.

    Reg,

    Chris

    1717220 wrote:

    Please update your forum profile with a recognizable username instead of "1717220": Video tutorial how to change username available

    ORA-20987: APEX - interactive report region does not exist in the application

    I'm trying to get the query of an international registration (interactive report) on a specific page in my application.

    The code I am using is thesi:

    create or replace function get_report_query(nPage_id IN number)
    return varchar2
    as
    l_report  apex_ir.t_report;
    l_query  varchar2(32767);
    l_list  varchar2(32767);
    nRegion_id number;
    nIR_id number;
    nm  owa.vc_arr;
    vl  owa.vc_arr;
    BEGIN 
    
        SELECT region_id
        INTO nRegion_id
        FROM apex_application_page_regions
        WHERE application_name = 'E-BRIL'
          AND page_id = nPage_id
          AND source_type = 'Interactive Report';
    
        nIR_id :=
          apex_ir.get_last_viewed_report_id (p_page_id        => nPage_id,
                                            p_region_id      => nRegion_id);
    
        nm(1) := 'DUMMY_JUST_TO_SET_UP_OWA_UTIL';
        vl(1) := 'WHATEVER';
        owa.init_cgi_env( nm.count, nm, vl );
    
        l_report := APEX_IR.GET_REPORT (
                        p_page_id  => nPage_id,
                        p_region_id => nRegion_id,
                        p_report_id => 0); 
    
        l_query := l_report.sql_query;
        for i in 1..l_report.binds.count
        loop
            l_list := l_list||i||'. '||l_report.binds(i).name||'='||l_report.binds(i).value;
        end loop;
    
    return l_query;
    end;
    

    I want to get the query of the IR on my page 3. And I run;

    get_report_query (3)

    That's what I get:

    ORA-20987: APEX - interactive report region does not exist in application, page 3 and 1278226325207011749 region. -Contact your administrator of the application.

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 630

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 911

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 33

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 55

    ORA-06512: at "EBR_OWNER. GET_REPORT_QUERY', line 19

    The regio_id seems ok, because when I ask this region_id of apex_application_page_regions, id 1278226325207011749 is returned.

    Page 3 is also correct.

    I tried to follow Denes Kubicek his blog (Denes Kubicek ApEx BLOG: interactive report query is).

    What I'm doing wrong here?

    We use the Apex 4.2.

    The '0' in line 31 should be "nIR_id".

    What is the purpose of the lines 24-26?

  • 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

  • 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 
    
  • Add radio button to each row of an interactive report: possible or not?

    First of all, let me explain what is the point of this application.
    I do an application that allows you to select an item in a drop-down selection list. This list is a list of food categories. Suppose the user selects "Fruit."
    Then the page refreshes and shows an interactive report with a list of foods which belongs to the category of fruit.

    This is where I want to change things:
    I want the user to be able to view the interactive report, but in this interactive report, I would like to add a button for each row.
    Then, when a certain type of food is selected (say "Strawberry") via the radio button, a text field should appear under the interactive report. In this textfield, the user can then add the weight of the food, and then it will calculate how many carbs in strawberries there.

    All that I really want to know is:*.
    How can I add an option button to each row of the interactive report, and how to bind this option button to the value of that particular line? *



    Additional information:
    The "P17_FOOD_CATEGORY" element contains the following LOV:
    Select FOODCATEGORYNAME as display_value, FOODCATEGORYID as return_value
    of FOODCATEGORY
    order by 1

    The 'Food' region contains the following source:
    Select a.FOODID, B.SID, b.FOODCATEGORYNAME, c.STANDARDAMOUNT, c.NAME unit
    food an inner join FOODCATEGORY b
    On a.FOODCATEGORYID = b.FOODCATEGORYID join FOODUNIT c
    On a.FOODID = c.FOODID
    where a.FOODCATEGORYID =: P17_SET_CATEGORY

    EDIT:
    PLEASE, I BEG YOU! Even if you don't know an answer, or if you are unsure of your answer, publish! Same suggestions will be welcome! I really need all the help I could get, even if it's not much.

    Published by: 917169 on February 29, 2012 12:25

    Hello

    I had the problem, that you have found.

    >
    Error cannot change the interactive report query.
    ORA-12899: value too large for column 'APEX_040100 '. "" "" WWV_FLOW_WORKSHEET_COLUMNS '. "" DB_COLUMN_NAME' (real: 32, maximum: 30)
    >
    you found this problem because the size of this apex_item.radiogroup(1,a.FOODID) is longer than 30 characters, but we have certain restrictions for the column names, we cannot use more than 30 characters for column names, then for what his use of name of column, please see below changed the code.

    select  apex_item.radiogroup(1,a.FOODID) as "FOODID", a.NAME, b.FOODCATEGORYNAME, c.STANDARDAMOUNT, c.NAME Unit
    from FOOD a inner join FOODCATEGORY b
    on a.FOODCATEGORYID = b.FOODCATEGORYID join FOODUNIT c
    on a.FOODID = c.FOODID
    where a.FOODCATEGORYID = :P17_SET_CATEGORY
    

    Hope you help

    Thank you
    Jitendra

  • Interactive report Bind variable not working do not?

    Hello

    I'm new to APEX and try to find how to use APEX of interactive reports with bind variables. So, I created one with the following query:

    SELECT i1.if_bic_code, b.bicname, count (*) NTC
    OF IF_DATA i1, bic b
    WHERE i1.if_bic_code = b.biccode (+)
    AND i1.insert_date BETWEEN: P40_X1 AND: P40_X2
    I1.if_bic_code GROUP, b.bicname

    The report is supposed to show a number of comments by the bic_code (= bicname) of the IF_DATA table for the specified period.

    These 2 bind variables are actually 2 Articles in the same region, with the help of a DatePicker for them. They have no initial values. Thus, the report displays initially no record. After either by using the date picker or manually enter values in these 2 points and pressing go button doesn't always display no line. Am I missing something here? It seems that the query again to the database, or the bind variables do not take the values entered for them.

    TIA

    Hello

    If you are the Go button that appears on the interactive report action bar, you must add in page elements names that must be saved when you do this, as the page itself is not subject to (which is the normal action that saves your dates).

    To do this, change the attributes of the report and go to the bottom of the page. You should see a section attributes advanced with a parameter "Page to go". In this, enter:

    P40_X1,P40_X2
    

    -C' is a list separated by commas to names of page elements that you saved when you click the Go button

    Andy

  • Pass the value in the search on an interactive report string

    Hello

    I have a report interactive (page 2) page which I navigate from a main navigation page that contains a text box (: P1_PART_NO) and a button (which has details of the branch).

    Can someone tell me how to pass the value of: box at the top of the interactive report of P1_PART_NO in research and have the results filtered as a result that the page is loaded.

    I use apex v4.0

    Thanks in advance,
    Chris

    If you google
    put Apex ir report
    You should get some answers

    Gus

  • Interactive report - new columns not displaying when you reset report

    Hi all

    I modified a report query interactive to display additional columns, but when you select Reset the report the additional columns are not displayed. I know that I can select them via the menu actions, then ssave the report like the one by default, but I was wondering if there is anyway to "clean" the report parameters to show them all by default anyway.

    I use v 4.01.00.03 with no option to upgrade atm

    Thanks in advance

    Greg

    OK, so I found the table - wwv_flow_worksheet_rpts where you can directly update the REPORT_COLUMNS column to view the columns of your choice by default.

  • Using the formula: If 1 letter of string is not 'F', then null, otherwise...

    Hello:
    I need help for a formula on a column.

    If the data of the field starts with a 'F', then I need the 1st four characters.
    If the domain does not begin with a 'F', I don't want the results.

    Domain name is: "-employee Custom Attributes. PICK_0 ".
    Formula to return the 1st four characters: LEFT (IFNULL ("-Custom Attributes employee".)) (PICK_0, 'NULL'), 4)

    I need the FI 1 character = 'F' then ' "and so on.

    Thank you

    Charlie EPEs

    Try this
    BOX WHEN "-employee of custom attributes. PICK_0 IS NOT NULL AND SUBSTRING ("-custom attributes employee".) PICK_0, 1, 1) = 'F' THEN SUBSTRING ("-custom attributes employee".) PICK_0, 1, 4) ELSE "END

    If the works marked as correct :)

  • How to add a field to a position fixed in Blackberry?

    I'm curious to see if it is possible to display a field in a fixed position on the screen and at the bottom most layer if another Manager or field painted on it, except the bottom of the screen. As if this field is added to the background of the screen, but will appear above the actual background that can be set using Screen.setBackground (). Are there any specific manager who can achieve this? Or a combination of them? As far as I can see there may be overlaps between the Manager of the layouts. Is this true?

    Almost impossible to achieve with BlackBerry built-in managers (not sure about AbsoluteFieldManager, available since 6.0.0 API). You can write your own handler, but be prepared for a difficult journey.

    You can try looking for LWUIT - it does not have this concept, I don't know if it's quite ready for BlackBerry.

  • Excel not downloaded in the same order as on the interactive report

    I have download to Excel on the interactive report, it is not sorted in the same way? Can I fix this?

    Hi Doug,.

    Could be a quick solution to this solution, you can have a download link on the header of the report area and that it points to a page that contains the same report with the csv model.

    Download CSV Report 
    
    where 3 is the page number for csv output report.
    *replace click by onclick
    

    or if you want more control over the report, you can create a button on the interactive report region and at the click of the button run a process to download a csv output file.

    Put dummy code for creating csv file

    DECLARE
    CURSOR cEmp IS
    SELECT
         Eno,Ename,SAL,DEPT
    FROM emp_table ORDER BY 1 DESC, 2 DESC,4;
    BEGIN
         owa_util.mime_header('application/octet', FALSE );
            htp.p('Content-Disposition: attachment; filename="Employee.csv"');
            owa_util.http_header_close;
    --Printer Header Row
         htp.p('Employee '  || ',' || 'Name'   || ',' || 'Salary'  || ','|| 'Department' ||  chr(13));
    for cThis in cEmp
    LOOP
              htp.p( '"'|| cThis.eno ||'"'||   ','|| '"'|| cThis.ename   || '"'|| ',' || cThis.sal||  ','|| '"'|| cThis.dept  || '"' || chr(13));
        END LOOP;
    htmldb_application.g_unrecoverable_error := true;
    EXCEPTION
              WHEN OTHERS THEN
                   htp.p('Download Error ' || SQLERRM || ' with error code ' || SQLCODE);
    END;
    

    Also, you can disable the download report link in the interactive report menu by going to reports-> Search bar attribute->, under include in the Actions Menu: uncheck the download option.

    I hope this helps.

    Thank you
    Manish

  • APEX 5.0 Interactive report (nopadding, how to set the line height)?

    APEX 5.0.

    Theme: 26. Productivity applications

    Interactive report region

    Where and how can I global set Dimensions height of the line and policies, etc., lines in interactive report?
    I use standard interactive report.

    Thank you

    user555867 wrote:

    Please help me in detail.

    The best way to get detailed help is to create an example on apex.oracle.com and share credentials of developer comments in the workspace here.

    I have:

    1 created a (= external CSS style sheet) file with the name 'ir_css_padding.css' local on PC (C:\tmp).

    2 added "Shared components"-> 'Static Application files'-> 'Download the file statistics Appl.': 'c:\tmp\ir_css_padding.css '.

    3. under "attributes of User Interface:

    (General properties)

    The value 'Statistics file prefix': ' #APP_IMAGES #ir_css_padding.css.

    'Media Type' value: text/css

    Why have you changed these settings? They are not relevant to the addition of static CSS files in the repository database. Read the help on line for these properties:

    Static file prefix

    Determines the virtual path of the Web server uses to point to static files when you use the #APP_IMAGES substitution string #.

    Do not specify what to do refers to files that are stored with your application definition in the database.

    For performance reasons, you can also store your application files on your Web server. Use a valid URL to refer to them.

    Media type

    Enter the Internet media type. An Internet media type is identifier into two parts for the formats of files on the Internet. A media type is composed of at least two parts: a type and a subtype and one or more optional parameters. This type of media used in the HTTP Content-Type header when the page is rendered.

    If both the values of page-level and the level of the application for the media Type are NULL, text/html is used.

    Two of these parameters must be null in your current environment.

    (The User Interface definition)

    "CSS File URL' value: 'text/css/ir_css_padding.css '.

    This parameter must use the static text of APP_IMAGES substitution string:

    &APP_IMAGES.ir_css_padding.css

    After that, I can't jerome in application. (See the only CSS text in the browser)

    --> WHAT IS THE PROBLEM?

    APEX is serving pages using the type of text/css media according to the incorrect media Type parameter described above. Remove and the app will return to normal.

    4. WHERE and HOW VALUE / reference the CSS file?

    I need this change for all interactive reports in my application, self think I can change my model that I use: 'interactive report Region '.

    Interactive report region isn't just a region container designed for use with interactive reports. It does not control the appearance of the interactive reports somehow. Not there at - it a report model for interactive reports. Their appearance can be changed using CSS.

  • between operator to group by date in the Apex of the interactive reports

    Hello

    In the filter of interactive reports, I could not find the "between" for the date field (got a "group by date" in my (source) sql query.) I wonder, is - this in view of the group by clause date?. Is there a way to show the operator "between" in the interactive reports filter.

    Thank you

    I just opened an existing style IR report, went to the actions, filter, selected a date column and found at the bottom of the list of values... Are you sure of the date that you want to filter on is a real date column?

    Thank you

    Tony Miller
    Webster, TX

    What happens if you were really stalking a paranoid schizophrenic... They would know?

    If you answer this question, please mark the thread as closed and give points where won...

  • Oracle Apex 5 - interactive reports (Mobile Application)

    Hello

    I tried to create Interactive report on the mobile application using apexea without success. He created the report but under report attributes I don't see report columns and it also gives me no data found error when I try to navigate off region edit and get new.

    Attached are the screenshots.

    Page developed using mobile-theme-51.

    Kind regards

    Alwyn Souza

    Hi Alwyn,

    always work on apexea? The problem you describe is a bug in the version installed on this system. It has produced if the interactive report icon was not explicitly enabled in the wizard to create a Page, in this case that the IR has not been fully created.

    Please do not import any application created the apexea in the final production of APEX 5.0 or apex.oracle.com version. You will need to re - recreate them from scratch.

    Concerning

    Patrick

    Member of the APEX development team

    My Blog: http://www.inside-oracle-apex.com

    APEX Plug-Ins: http://apex.oracle.com/plugins

    Twitter: http://www.twitter.com/patrickwolf

Maybe you are looking for

  • G7W25EA #AB7: battery

    Hello! First I use the my cell when I load it? Second, the battary (at 100%) is damaged if I continue to use the charger?

  • Unable to print the alignment page All - in-One D110 full

    I recently changed my printer cartridges and I cannot print a full alignment page.  I tried all the troubleshooting steps I can find and still no resolution.  Any help would be greatly appreciated.  Or if someone has a picture of an alignment page fu

  • Acer One 10 S1002 load questions

    My tablet will not fully charge. It will not turn on. After about an hour or two to leave it on the charger, the LED will Flash between red and blue. I tried the long hold button power, increase the volume and power button hold etc.

  • Aspire V5 - 473G

    Hello does anyone know if this laptop has slot mSATA? I saw configurations with 1 120 GB (120 GB SSD + 1 TB SATA III HARD disk), but it is still little doubt that this laptop might actually have two bays for hard drives. Thank you in advance. BR/Stan

  • 800b0100 failure update

    When I try to update to Windows VISTA, it fails and I get the error message: 800 b 0100. So I have downloaded and run the system update readiness tool. Now, read the CheckSUR.log, she has this: =================================Preparation of control