1 Conditional report based on 3 select lists/ 3 different select statements

I have made 1 report based on the three select lists. The report is displayed in the center of the page. The user needs to fill them in order, the select lists are:
Selectlist:
1. P1_LOVPG - Null is allowed, but is only appearing at top with a label of Productgroup
2. P1_LOVSG - Null is allowed, but is only appearing at top with a label of Subgroup
3. P1_LOVMA - Null is allowed, but is only appearing at top with a label of Manufacturer
LOVPG contains a distinct collect of the ProductGroups
QUERY LOV = select distinct pg from X
LOVSG contains a distinct collect of the SubGroups inside the selected PG.list
QUERY LOV = select distinct sg from X where pg = :P1_LOVPG
LOVMA contains a distinct collect of the Manufacturers inside the selected SG.lst
QUERY LOV = select distinct ma from X where sg = :P_LOVSG
Based on the the selected items the user would see the following:
Table X
PG SG MA ART
A-----X----M---1
A-----X----N---2
A-----Y----M---3
A-----X----M---4
B-----X----M---5
B-----Y----N---6
B-----Z----O---7
Seletion 1 PG = A -> selects PG A in select list result, User sees:
Report A
PG SG MA ART
A-----X----M---1
A-----X----N---2
A-----Y----M---3
A-----X----M---4
Query would be: select * from X where PG = :P1_LOVPG
Selection 2, user still sees the above, can only select from the SG select list NULL, X, Y. User needs to choose between X or Y value. He picks X, he sees:
Report B
PG SG MA ART
A-----X----M---1
A-----X----N---2
A-----X----M---4
Query would be: select * from X where PG = :P1_LOVPG and SG = :P_LOVSG
Selection 3, user still sees selection 2 on his screen, can only select from the MA list bewteen NULL, M or N, user needs to choose between M or N. He picks M, he sees:
Report C
PG SG MA ART
A-----X----M---1
A-----X----M---4
Query would be: select * from X where PG = :P1_LOVPG and SG = :P_LOVSG
As you can see the query changes as the user goes deeper into the structure. It is a simple if then else system where the quey changes. How do I set this up in htmldb?
(I've read something about Oracle's SQL and it's decode function, but can they be used with changing select statements?)

are you sure your data meets the JOIN conditions?
You can make a quick check.. only example...
select single * from KONP into ls_konp
where knumh = P_knumh.
if sy-subrc eq 0.
select * from from A905 into table lt_a905 where
     kappl in so_kappl
     and kschl in so_kschl
     and VKORG in so_vkorg
     and vtweg in so_vtweg
     and kondm in so_kondm
     and wkreg in so_wkreg
     and knumh = ls_konp-knumh.
if sy-subrc eq 0.
select * from A919 into table lt_a919
for all entries in lt_a905
where kappl = lt_a905-kappl
and kschl = lt_905-kschl
and knumh = lt_905-knumh.
endif.
endif.

Similar Messages

  • Sub Select list within the Select List!!

    Hi All,
    I want one solution, i want to have a sub select list within the select list, i mean i want to have a dropdown shown when we point a cursor on any of the Value of
    the select list. Sub select list for that value of the select list.
    Hope you all got it,Please Reply me if anybody has the solution, I am using APEX version 3.0.1.00.07
    Thanks

    Hm,
    Service Unavailable
    The proxy is currently unable to handle the request due to a (possibly) temporary error. Extended error information is:
    * Failed to forward the request to the web server at apps.oraclecorp.com:80. This may be due to a firewall configuration error or a DNS failure.
    If this situation persists, please contact your security gateway administrator.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Select list: Display the selected value using JSP

    Hi
    I have a select list with a set of values and when I select a value from the list I want the selected text to appear on the screeen. How do I display the selected value?
    Please help:
    Here is the code for the list:
    <select name="arraySelect" size="8" onclick="">
    <%for (int i = 0; i < dumpArray.length; i++) {
    if( i == 3){
    %>
    <option value="<%=dumpArray%>" selected><%=dumpArray[i]%></option>
    <% i++;} else %>
    <option value="<%=i%>"><%=dumpArray[i]%></option><p>
    <% } %>
    </select>
    <% String name;
    name = request.getParameter("arraySelect");
    out.println(name);
    I tried request parameter but it did not help. How can I do it?

    did you submit your page?

  • SCCM Report Based on Microsoft Product list

    Hi Dears
    I need report for software Update in sccm Based on product list.
    what shall I do?
    Best Regards

    software update ? can you be little more specific ?
    are you looking for inventory information ?
    Eswar Koneti | Configmgr blog:
    www.eskonr.com | Linkedin: Eswar Koneti
    | Twitter: Eskonr

  • Refresh PL/SQL Report Region (not Page) using Select List value

    Hi,
    I've got a report region based on a 'PL/SQL function body returning a SQL query'which gets generated on selecting a value from a Select list item, The Select List action is 'Redirect and Set value' but this causes the whole page to refresh rather than just the report region. I've tried to refresh the report only using a dynamic action on the Select List item (Action now reset to  'None') but now the report is not appearing on choosing from the List. Can anyone suggest a solution that will allow me to refresh this report without refreshing the page? I am using APEX 4.2.2 and the report syntax is as follows:
    DECLARE
      v_statement VARCHAR2(500);
    BEGIN
      SELECT query_text
        INTO v_statement
       FROM sql_queries
       WHERE query_id = :P2_QUERY ;
       RETURN v_statement ;
    END ;
    where P2_QUERY is Select List Item,
    regards,
    Kevin.

    KevinFitz wrote:
    The report region being displayed is conditional on P2_QUERY item being NOT NULL. I assume the region not appearing is because the Action for the Select List Item is set to None and so P2_QUERY is always NULL.
    No, the region is not appearing because it is conditional on P2_QUERY being NOT NULL. This means that the report region never exists on the page shown in the browser, so it can't be dynamically refreshed. (Dynamic refresh doesn't evaluate region conditions, and it only re-renders the report content, not the entire region.)
    Remove the condition on the report region, check the refresh is working, then reconsider exactly what the requirements here are. If you want the region to appear only when P2_QUERY has a value, and you want it to be refreshed without submitting and re-rendering the page, then the region needs to be hidden rather than conditionally rendered, and shown via a dynamic action when P2_QUERY gets a value.
    I tried adding an additional Set Value True Action for the DA event but got an error as listed above,
    All irrelevant if Page Items to Submit on the region is used properly.

  • Select list with submit issue when they are referred in report region query

    I have a page with a reporting region. Same region also has 3 different list items and depending on the value selected in each item, the report is refreshed. All the 3 list items are "Select list submit with submit"
    Out of 3 items, 2 (say item2 and item3) are populated through dynamic LOV using the value in item1.
    Additionally, when I select a default "ALL" value in in item1, I ignore values in item2 and item3.
    With this background, I am a following issue:
    1. I select a value other than Default value in item1 which filters the report.
    2. Then I select some value in item2 which further shrinks the reports.
    3. Now if I go back to item1 and select the default "All" value, the report is not refreshed with the new values of item1, item2 and item3. But it still shows the report based on value of item2 that I selected in step2.
    How do I set the value of item2/item3 to null if value of item1 is default which is "All"
    Any word of advise will be a great help!
    Thanks,
    Girish

    Hi,
    Make two computations each with the computation text NULL; or
    Make one process with code like:
    BEGIN
    :P1_ITEM2 := NULL;
    :P1_ITEM3 := NULL;
    END;With the condition "Value of Item in Expression 1 = Expression 2"
    Expression 1: P1_ITEM1
    Expression 2: ALL
    (or whatever the return value of ALL is...remember that this is case sensitive)
    Mike

  • Select list null value issue - for filtering the tabular form report

    hello,
    I have a tabular form created on emp table and in the table their are entries for the employees who don't have a location, like it is null for some of the employees.
    Now I have created a select list item - for filtering the results based on location.
    my select query for select list item is
    select distinct location_name d,location_id r from emp order by 1
    -- so my select list contains all the distinct location_name including the null on my tabular form.
    so based on the selelcted value(in the select list), I am able to filter the results in my tabular form.
    but the thing is that when i try to select an null value from my select list - i am not able to filter my report - like its displaying all the records, its not filtering.
    can anyone help me out with this.
    thanks.

    Hi
    Try below select for LOV
    select distinct nvl(location_name,'No Location') d,nvl(location_name,'No Location') r from emp order by 1 And then change tabular from select where clause also use nvl(location_name,'No Location') like
    SELECT *
    FROM emp
    WHERE nvl(location_name,'No Location') = :Px_YOUR_ITEMBr, Jari

  • Filter report on multiple select lists dynamically

    Hello
    Can somebody tell me how to filter/refresh a interactive report based on multiple select lists?
    The select lists are created with apex_item.select_list_from_query, because I need to create them dynamically.

    do not post duplicate questions/posts when you already have {message:id=10453848}
    It doesn't make any sense

  • Order in a Select List based in a LOV is wrong

    I have a select list based upon a LOV SQL Query.
    Values in table are:
    FIELD
    001
    002
    003
    AAA
    when I make query in SQL Workshop:
    select FIELD from TABLE order by FIELD;
    I get
    001
    002
    003
    AAA
    But when I make a similar query in LOV the result is in the select list
    AAA
    001
    002
    003
    Someone knows what is happening?
    Thank
    Ander

    mhichwa wrote:
    It looks like your application is running a different sort / NLS preference then is the SQL workshop. Is there a chance your application identifies a language that sorts differently then default APEX. I am just guessing but it could explain this behavior.OK, I think something like this is happening because my Oracle instance have SPANISH like a NLS_LANG parameter, but why is different result between sql Workshop and LOV query, I have installed english and spanish languages in my apex instance, I get the same problem in both cases.
    Other curious think is that my min and max values are OK,
    for example
    BETWEEN: <select list 1> AND <select list 2>
    default value for <select list 1> is
    DECLARE
    exitvalue varchar2(10);
    BEGIN
    select min(FIELD) into exitvalue
    from TABLE
    return (exitvalue);
    END;
    I get 001
    default value for <select list 2> is
    DECLARE
    exitvalue varchar2(10);
    BEGIN
    select max(FIELD) into exitvalue
    from TABLE
    return (exitvalue);
    END;
    I get AAA
    But select list are ordered like
    AAA
    001
    002
    003
    I have based select list in a lot of different sql ways
    select FIELD from TABLE ORDER BY FIELD
    select FIELD from TABLE ORDER BY 1
    select FIELD from TABLE ORDER BY FIELD ASC
    select FIELD from TABLE ORDER BY 1 ASC
    Other extraneous think is that I use DESC order I get
    003
    002
    001
    AAA
    Thanks
    Edited by: user10999912 on 24-Jul-2010 08:07

  • Based on select list, i need to retrieve values in other select list

    Hi,
    am new to apex using apex3.2, i need to retrieve values in select list based on the other select list vale with out refreshing page.
    ie i have region select list and country select list,in country corresponding region country must be display but with out refreshing page.
    can you please any body guide me.
    Regards
    shashidhar
    Edited by: 871140 on Jul 7, 2011 10:34 PM

    Hi,
    you can use cascading LOV for that, i which the other LOV field will be changing depending upon the selection of other value(which is in LOV).
    http://www.inside-oracle-apex.com/oracle-apex-4-0-cascading-lovsselect-lists/
    Regards,
    Mini
    Mark Answers Promptly

  • Select List based on other select List

    Hi
    I have 2 select lists when a selection is made in one I want the second list to be limited but when nothing is selected in the first list I want the second list to display all. Apolgies if this is really a plsql thing .
    Heres what I have so far
    if :P52_ORGNAME is null
    then
    return 'select unique surname d,id r from com_contact';
    else
    return 'select unique forename||surname d,id r from com_contact where orgname = :P52_ORGNAME order by id';
    end if;
    the else is fine but I cant get the null condition to work.
    :P52_ORGNAME is a select list where show null is yes and there is no NULL value
    thanks in advance
    Kirk

    Hi,
    you can try 2 things.
    1)try putting a null display value and keep null return value as blank. dont put any value in the default value also,and see if this works,
    2)else try putting a null return value(like BLANK) and check for that value in the condition insted of null. i.e
    if :P52_ORGNAME ='BLANK'
    then
    return 'select unique surname d,id r from com_contact';
    else
    return 'select unique forename||surname d,id r from com_contact where orgname = :P52_ORGNAME order by id';
    end if;
    Hope it works..

  • Select List with Submit - Branch Error - form data does not save

    I am a new APEX user so please excuse my ignorance. I have created a simple application in which a primary data entry form branches either to a detail form (one to many on the parent ID) or a master tabular report used for navigation. These branches work fine. Then I tried to get a little fancy with a conditionally displayed element based on the value the user selects in a select list on the main form(P9_REPORT_TYPE). I converted the select list to a select list with submit and created a new branch (on submit - after processing) to the current page (Page 9) to avoid the "no branch found" error. To avoid the branch being unconditional, I tried to use the 'Request = Expression1' condition with the Expression 1 field set to P9_REPORT_TYPE. The behavior I get is that the page seems to submit but the data on the form is not saved -- even the new value selected in P9_REPORT_TYPE reverts to the old value. I simply need the page data to submit so that the conditionally displayed element will take effect (which it does if you use one of the other button-based branches and then return to the form). Do I have the syntax wrong? It seems like this should be straightforward but I've tried a number of options including using a PL/SQL condition V('REQUEST')='P9_REPORT_TYPE' with no success. I'm guessing that the value of Request is getting cleared before it has a chance to trigger the branch? Any help would be greatly appreciated.

    Exactly so! Thanks Scott for setting me straight. For the benefit of other readers, the value in the Source Used column had been set to "Always, replacing any existing value in session state" and should have been set to "Only when current value in session state is null".

  • Filter Report based on Apex_item.select_list

    I have question for you here.
    I have a page where I create some page items with apex_item.select_list_from_query based on a hidden item.
    So for example sometimes it creates 3 select lists and another time it creates 2 select lists. That works fine.
    But now I want to filter a report dynamically based on the selected values in these select lists.
    Does anyone have a solution to do this?

    Yes I understand that you have to know more about the table structure. So I translate that part of the datamodel in English for you and you can see it by the url below:
    http://i48.tinypic.com/349dp4g.jpg
    So it is a many to many relationschip between Article and ArticleOptions and the Values table contains the article id and article option id, who are together the primary key.
    And of course the values table contains the corresponding value.
    So if you can see in the datamodel a article group can contains multiple articleOptions, therefor I had to create dynamically the select lists based on the number of articleOptions of that group. That works! And thanks to your help I can filter the article list based on the selected value in a select list. But the problem is that when I have 3 select lists I have to filter the report based on the values in the 3 select lists.
    For example the first select list is articleOption Colour and contains the values blue,white,black. I select black, the report have to show only the articles who have te colour black. And the second list for example contains the articleOption storage with the values 150gb,250gb,500gb.I select 500gb. The report only have to show articles who contains the colour black and a storage of 500gb.

  • APEX 4.0.2 Multi-selection on a cascade LOV select list only pass 1 value

    Hello everyone,
    I am struggling to make a cascading LOV select list has multi-selection.
    On one report page.
    I have 2 select list
    The first one lists the court name (P4_COURT_NAME), the second one (P4_DEFENDANT) list all defendants who currently engaged in the court.
    The problem is when I allow the defendant select list become multi-select, when it submit it only pass the first selected value.
    So I create just a simple select list based one list of value, and make it allow multi-selection. When it submit, the normal select list can pass selected values properly, while the cascade LOV select list pass only the first selected value.
    Please help if any of you have an idea why.
    We use APEX 4.0.2.00.07, Oracle data version iis 11g
    The some configuration settings I set for the P4_DEFENDANT IS
    Value required: Yes
    Page Action When value changed: None
    Allow Multi Selection: Yes
    Named LOV: --Select Named LOV-
    Display Extra value : Yes
    Display Null Value: Yes
    Null Display Value: --Select—
    Null return value:
    Cascading LOV Parents Items: P4_COURT_NAME
    Page Items to Submit: P4_DEFENDANT
    Optimize refresh: YES
    List of value definition
    SELECT def.first_name || ' ' || def.surname || ' (PRN: ' || def.prn || ' )' as d, def.def_id as r
    FROM defendant def INNER JOIN court_engagement ce
      ON def.def_id = ce.defendant_id
    WHERE (ce.date_joined_aodt_court IS NOT NULL
      AND (ce.date_terminated IS NULL OR to_date(ce.date_terminated,'dd/mm/yyyy') > to_date(sysdate,'dd/mm/yyyy'))
      AND UPPER(ce.court_name) LIKE UPPER(:P4_COURT_NAME)
      AND ce.active = 1)Source Used: Only when current value in session state is null
    Source Type: Static Assignment
    Maintain session state: Per session
    The rest is default.
    Thanks in advance.
    Ann

    Hi Chintan,
    The "Source used" for those items are "Always, replacing any value in the session state". To set them to "Only when current value in session state null" sounds a good solution to me.
    However, a strange thing just happened - now I will not lose the values of the items after the page reloading, although I have changed nothing in the page in my application since I asked the question. I don't understand why all of a sudden the reloading doesn't make me lose changed values any more. Let me dig it tomorrow to see what I'll find.
    Thanks so much for your help.
    Christine

  • Can you order by label of select list in tabular form?

    Imagine this scenario, you have an updateable tabular report based on a query like the following:
    select emp_id
          ,ename
          ,dept_id
    from employeesAnd you define the dept_id column as a query based lov, so you see a select list for departments.
    select dept_name d
          ,dept_id   r
    from departments
    order by 1However if the user chooses to order by the department column by clicking on the heading to sort, they see the following order (note the H between A & B):
    Accounting
    Human Resources
    BiodiversityWhich is because of the ID not being in the same order as the label
    1 - Accounting
    3 - Biodiversity
    2 - Human ResourcesHow can I allow the user to order by the lov based column, but have it order by the label and not the reference id?
    A colleague reckons she fought and lost this battle. Surely this must be a common issue? I can't seem to find any related questions.
    Cheers,
    ScottWe.

    >
    Option B: Convert to manual tabular form. Here is a sample of the report query (leave column display as at "standard report column").
    select e. emp_id
          ,e.ename
          ,'&lt;input type="hidden" value="'||d.dept_name||'" /&gt;'||APEX_ITEM.SELECT_LIST_FROM_QUERY(3,e.dept_id,'select dept_name ,dept_id  from departments order by 1') dept
    from employees e, departments d
    where e.dept_id = d.dept_idI recently had problems when I had to apply a script to a page that used this technique: basically too many <tt>input</tt>s. Never understood why this element is used&mdash;guess it's the fact that it's "hidden". Anyway, an HTML comment works as well and is more out of the way:
    select e.empno
          ,e.ename
          ,'<!-- '||d.dname||' -->'||APEX_ITEM.SELECT_LIST_FROM_QUERY(3,e.deptno,'select dept_name ,dept_id  from departments order by 1') dept
    from emp e, dept d
    where e.deptno = d.deptno

Maybe you are looking for

  • IPhone won't charge using Mophie Juice Pack after upgrade to 3.1

    I have an iPhone 3GS. I have been using a Mophie Juice Pack to charge it with good results. After the upgrade to 3.1, the Juice Pack no longer charges the iPhone. I get the dreaded message, "This accessory is not made to work with the iPhone." Of cou

  • Swapped Monitors now I have no display

    Today I was trying to configure my system to display on 3 monitors all using differing outputs: DVI, VGA, HDMI which were on my video card. It seems that the card can only render two monitors at a time. But the bigger problem now is that something we

  • Reg Mass maintenance in Material master

    Dear Gurus,                        I have uploaded HALB material wth movng avg price by mistake....I want to change it to std price in accounting view. Kindly guide me how to change it as standard price.

  • Starting Essbase Server

    Dear all, I finished Foundation Services, Essbase and Planning installation and started the applications using start.bat|sh. When I run the EPM System Diagnostic, i had the following error messages: FAILED EAS: Essbase Server Validating Essbase Serve

  • SUBCONTRACTING(BY-PRODUCT)

    HI, I wnt to map following scenario :- We are having a bar of length of 5000mm(A) We want to cut it in two bar 3000mm(B) and 2000mm(C) Material master for all 3 material were created. I am creating a PO for 3000mm (B) with item cat L In component I a