Interactive report formula calculate field - region

Hello

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

There is a 'COUNTRY CODE' field.
I want to add field of computation called 'REGION '.
The logic is as follows:
If "COUNTRY CODE" is "to THE" or "KR" or "CN", "IN", then the value for the "REGION" field must be "ACPA".
If "Country CODE" is "AR", "BR" or "MX", then the value for the field "RÉGION" or "PE" must be 'BOY '.
If 'CODE' is 'US' or 'CA' then the value for the field "RÉGION" must be "NAM".

Would appreciate your help.

Thank you
Guy

Hello

Try

DECODE( E ,'AU','APAC','KR','APAC','CN','APAC','IN','APAC','BR','LAD','AR','LAD', 'PE','LAD','MX' ,'LAD','US','NAM' ,'CA','NAM',NULL)

Kind regards
Jari

Published by: jarola 7 Sep 2010 09:54

Change the beginning of the function decode E according to your column letter

Tags: Database

Similar Questions

  • Can we have option all interactive report 4.2

    Hi all

    In our application, we had used interactive report where required fields can be sorted, as well as the option can show option 'all' as well in the filter option.

    For example, we see all of the columns that appear here.

    Now for each header, I had chosen the options sort and filter as shown below

    As we are showing upward and down options, can have as 'All' option, by clicking on 'All' they used to know all the necessary information.

    Apex Version - 4.2

    Summit theme-Light blue-100

    Kind regards

    Sruthitamiri.

    Sruthi Tamiri wrote:

    Suppose that we show these values under the header of the region

    "Now we add more regions in tables, so that it is reflected in more top of the screen, where there exist regions more we Let's scroll appears, now suppose that if they want to search with the keyword 'A' then it displays the corresponding values as"Asia", Asia iron ore" and so forth... then the report will filter based on these values If the condition is that, if we provide as 'All' option, when they click on this option, you see all the values in the report.

    Which, as stated above is equivalent to having no filter at all. Users must disable or remove Active filters in the Panel of IR control over the release of the report.

  • Filter values and to_date interactive report

    Hello world

    I am trying to add a filter in an interactive report on a field that is defined in the query as follows:

    Select TO_CHAR (TO_DATE (comm. MONTHS, 'MM'), 'MONTH') AS 'MONTHS' from sometable

    Comm. month is a date field

    It works properly when it shows values, they have the name of the month.

    The problem is when I try a filter to aid 'to' article. I can see the different names of months in the drop-down list and I can add to the list of filters (i.e.: MAY, JUNE) but when I click on Apply I behaving strangely, as always by selecting all the lines or not if you select anything.

    Any idea? Oh, I'm using Apex 4.0.2 btw.

    Try it here: Page 1

  • interactive report showing vertical grid lines

    Has anyone fitted an interactive report so that it shows vertical grid lines? I see the default horizontal lines, but I think the vertical lines will my data easier to read. Just can not understand how to do this.

    Hello Edward,.

    @Jeff Eberhard was a good solution for vertical grid lines display.

    Here is the solution for the whole grid for interactive report to include in Region region of header/footer page/HTML header:

    
    

    I hope that helps!
    Kind regards
    Kiran

  • Interactive report > calculate the creation field > formula

    I am trying to create a calculation field in an interactive report in APEX 3.

    There are two fields: 'Plan Type' and 'Type of product.
    I want to create field calculate - balance 'My '.
    Condition is as follows:
    If the value of the 'Plan Type' field starts with 'FY11 AA' and the value of the field "Product Type" ends with "ABC" then "check my ' value of the field should be 'CHECK' else 'OK '.

    "Type plan"-"product Type" -"my check.
    FY11 AA123 - 123ABC - CHECK
    FY11 BB123 - 123KKK - OK
    FY11 CC123 - 123ZZZ - OK

    Would appreciate if you can write a formula to the previous case to me.

    Thank you
    Guy

    Hello

    CASE WHEN A LIKE 'FY11 AA%' AND B LIKE '%ABC'
         THEN 'CHECK',
         ELSE 'OK'
    END
    

    Replace the 'A' and 'B' with the relevant column alias appears on the screen.

    See you soon

    Ben

    Published by: Munky on 6 Sep, 2010 09:55 - typo

  • 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

  • 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 
    
  • Placeholder for the field of research in interactive report Oracle Apex5.0

    Hi all, I have some interactive report region, I have enabled search box, how to give the name of the licensee for this area of research? Please give suggestion

    search.jpg

    Thank you

    Try using this jQuery on the page loading

    $('.a-IRR-search-field').attr ('placeholder', ' Hello world ' ");

  • By using the search field of the interactive report

    Hello

    I want to use the search field of the interactive report to set this value in a page item, use it to pass this value to another feature.

    How can I do this?

    Concerning

    Eve wrote:
    Hello

    I want to use the search field of the interactive report to set this value in a page item, use it to pass this value to another feature.

    How can I do this?

    Concerning

    Create a dynamic action as follows:

    Event: Before updating
    Selection type: Region
    Region:

    Real Action:

    Action: Run the JavaScript Code
    Code: $s ('PX_YOUR_ITEM_NAME', $v ('apexir_SEARCH'));

    Click on create

    When it is created, change the dynamic action and define the scope of the event on the dynamics

  • Set the size of the field in the report and the interactive report

    Hello.

    I have 2 questions.

    1. How do I report and interactive report to broadcast 100% of the width of the screen, even with just 1 column?
    2. how to set the custom field size. For example, first field should be 100px 200px second and so forth

    Thank you.

    This is to answer your second question.
    Define the columns with a width of custom field?
    Go to declare attributes--> click Change next to the domain name-->
    Find the region column--> CSS formatting style:
    Enter the values you want to account for your specifications.

    Ex: CSS Style: Width: 100px
    or Style CSS: Width: 200px

  • Footer text region appearing to the right of the BAR INTERACTIVE REPORT SEARCH page

    We are the migration of Express 4.2.1 application at Apex 5.0.2


    We use the 22 Bluejay theme.

    In my interactive reports, I the text entered in the regions 'Header and footer' > footer text, including 4 Apex, rendering at the foot of the report.

    The Apex 5, the same text renders in a new column to the right of the search bar of interactive report.

    Is it a question of model, or a builder bug?

    I can't find where in the model I can adjust the positioning of the text 'Footer region'

    Gus...

    I worked on it a little more.

    just to say that I use the Chrome browser.

    I worked as designer of the Page view and impossible to find using the attribute "footer text".

    I went to the view of the component and found help.

    It is said...

    Enter a footer area to display directly after the body content (that is, after #BODY# in the model of the region) or instead of #REGION_FOOTER #, where this substitution string is defined in the model.

    So I added #REGION_FOOTER # div AFTER the body...

    #BODY #.
    #REGION_FOOTER #.

    Hurrah!  the footer is now in the right place...

    Also, I noticed that if I placed an HTML element
    in the text, footer text would be in the correct position without having to change the model.

    Gus...

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

  • Horizontal scroll bar in the model of interactive report region 5 Apex (universal theme)

    Hello

    We have migrated our application from 4.2 (theme: 21 scarlet) to 5.0 (changed to universal theme). Most of our reports are interactive reports and have more than 20 columns to display in the reports. 4.2 in the 'Region of report"model horizontal scroll bar came from bottom of page like below and has been easy for the user to scroll through the options to the right and see all the columns.

    Apex4.2.PNG

    In the universal theme apex 5 with 'interactive report' model in order to see the columns on the far right in the first lines user must scroll the vertical bar first, then scroll horizontal straight bar and vertical bar to go to the top


    Apex5.PNG


    How can you have the scroll as in 4.2 bar region of report model. I think that we need to make some changes in CSS and also need to copy the existing model and make changes and use this model in all reports.


    Thank you.

    RAM


    Hi Tim,.

    Thanks for the reply. I tried this option before posting forum. It did not work. Now, after changing position attribute fixed to the ' Page "(or region) in the report attributes section it works." " When we migrated the app at UT, he has been on 'None '. Problem solved now. Thank you.

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

    Hello

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

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

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

    Concerning

    Hi user10248308


    Try this


    Step 1:-modify the interactive report

    Step 2:-under defination region-> header area

    put

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

    put


    Please come back if this is not yet resolved.

  • How to increase the size of the field the Filter Expression in an interactive report.

    Hello

    My uses user field of the expression of the filter in the interactive reports with multiple values and want to visualice the contents of the field, is it possible?

    Thank you

    Do you know how to use jQuery?

    I'm looking at this as, this is what I have so far:

    I don't really like how it works yet, but looks like a direction to go.

    Although I currently use Apex 3.2.

Maybe you are looking for

  • Need to convert System 7 sounds

    I have 20 years, sounds, from the OS system 6 or 7, I would convert to play on my iMac El Capitan. They appear as Unix executable files. Remember at this time, used Mac resources with no extension ranges. I used the following apps but have failed: Pe

  • Whenever I try to move an object and place it in the pages, it climbs to an odd

    I am trying to create an organization chart into pages. Almost every time I try to move an object (a text box or a line) to place it somewhere again, he climbs to a weird spot on the document. Here is a video showing what is happening. For some reaso

  • battery drains more than 50% of the overnight just in mode 'sleep'

    I got the macbook pro retina display since Dec. 4... so its been 17 days only.  I woke up this morning to find my laptop battery to 33 percent, after going to sleep with him to 87% in mode 'sleep'.  I did some research and that you turn off bluetooth

  • 5742e: photo blurry printing

    I bought and installed a 5742nd printer a few days back and to press a few photos with the pack that was locked, I set the printer for the Lac photo, both high and standard quality printing and size 4 x 6 and yet each one each photo was a total disas

  • Hard drives not recognized

    Here's my problem. I want to do a clean install of windows 7 64-bit. When I try to install, Windows sees none of my hard drives (5 of them). They are running Windows with no problems.