Report over two tables with shuttle seperated values listed per row

Hy,
I have created an application with 3 Tables: products (P_ID), applications(A_ID), crosstable (ID, A_ID, P_ID) for the assignment.
In the app it´s possible to define the involved products for each application.
Now I need a summary page, where all involved products, for each application are listed.
My problem is, the table application (column:products) includes only tangent product PK, seperated by comma as a result of a shuttle field.
For the summary report i need all app informations incl. product real names, correctly listed, each in a row.
Exists a simple chance without BI-Publisher to create this report, maybe with decode or similar.
Thanks Tom

Hello,
Did you already have a look at apex_util.string_to_table (and table_to_string)?
I guess that could help you.
An example is here: Using Shuttles and multiple values.
Regards,
Dimitri
-- http://dgielis.blogspot.com/
-- http://www.apex-evangelists.com/
-- http://www.apexblogs.info/

Similar Messages

  • Two tables with different filter values base on a analysis

    Hi guys,
    let assume that I have a analysis with columns : group_id and sales.
    Based on it I would like to create two tables : table1 where group_id =1 and table2 where group_id = 2.
    Is OBIEE capable of doing it?
    Regards,
    Slavi

    Hi Slavi,
    You can do that in single analysis, but you need to have the group_id column two times.
    That is, bring group_id_1, group_id_2 (same column), sales
    Now in table 1,
    bring group_id_1, sales
    Then in selection steps for group_id_1 -> Select Members -> Action choose keep only -> choose the filter value 1
    This will filter the table 1 with group_id 1
    In table2 bring group_id_2, sales
    Then do the same step for group_id_2 with value 2.
    now in same report you have two reports with different filter.
    If you want you can keep the same column name for both group_id columns, I just kept group_id_1, group_id_2 for easy reference.

  • Rendering a table with more than one record per "row"

    Ok, it's like this. I have a collection that I want to render as an ADF Table with a single column. Except I want to render multiple entries in the collection per row of the table
    i.e. a normal ADF table would be like:
    [Column Header]
    [Row1.TextField]
    [Row2.TextField]
    [Row3.TextField]
    [Row4.TextField]
    [Row5.TextField]
    I would like to render it something like:
    [Column Header]
    [Row1.TextField] [Row2.TextField] [Row3.TextField]
    [Row4.TextField] [Row5.TextField]
    That is, I want to add each record's text field horizontally first before adding a new row vertically.
    Any way to do this with the ADF Table? Or is there another component I should use?

    Hi,
    you can try the "af:iterator" component
    example
    <af:panelGroupLayout id="pgl4" layout="horizontal">
                    <af:iterator id="i1" value="#{bindings.MyTree.collectionModel}"
                                 var="row" varStatus="vs">
                      <af:panelGroupLayout id="pgl5"
                                           rendered="#{(vs.index mod 3) eq 1}"
                                           inlineStyle="width:100px;"
                                           layout="horizontal">
                        <af:outputText value="#{row.CityCode}" id="ot2"/>
                      </af:panelGroupLayout>
                      <af:panelGroupLayout id="pgl6"
                                           rendered="#{(vs.index mod 3) eq 2}"
                                           inlineStyle="width:100px;"
                                           layout="horizontal">
                        <af:outputText value="#{row.CityCode}" id="outputText3"/>
                      </af:panelGroupLayout>
                      <af:panelGroupLayout id="pgl7"
                                           rendered="#{(vs.index mod 3) eq 0}"
                                           inlineStyle="width:100px;"
                                           layout="horizontal">
                        <af:outputText value="#{row.CityCode}" id="outputText4"/>
                      </af:panelGroupLayout>
                      <af:outputText value=" &lt;tr>" id="ot3" escape="false"
                                     rendered="#{(vs.index mod 3) eq 2}"/>
                    </af:iterator>
    </af:panelGroupLayout>Regards
    Nicolas

  • MATERIALIZED view on two tables with Fast Refresh

    i Wanted to create MV on two tables with Fast refresh on commit.
    I followed below steps
    create materialized view log on t1 WITH PRIMARY KEY, rowid;
    create materialized view log on t2 WITH PRIMARY KEY, rowid;
    CREATE MATERIALIZED VIEW ETL_ENTITY_DIVISION_ASSO_MV
    REFRESH fast ON commit
    ENABLE QUERY REWRITE
    AS
    select A.ROWID B.ROWID,a.c1, DECODE(a.c1,'aaa','xxx','aaa') c2
    from t1 A
    join t2 b
    on AB.c1= CD.c2;
    i am getting below error.
    Error report:
    SQL Error: ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
    12054. 00000 - "cannot set the ON COMMIT refresh attribute for the materialized view"
    *Cause:    The materialized view did not satisfy conditions for refresh at
    commit time.
    *Action:   Specify only valid options.
    Basically i want to take record in MV by joinig two tables and if both of the base tables will updated then record should reflect in materialised view.
    Please do the needfull.

    does the table support PCT? the other restrictions on joins look to be ok in your statement.
    maybe try creating first with on demand instead of commit to see does it create.
    http://docs.oracle.com/cd/B19306_01/server.102/b14223/basicmv.htm
    >
    Materialized Views Containing Only Joins
    Some materialized views contain only joins and no aggregates, such as in Example 8-4, where a materialized view is created that joins the sales table to the times and customers tables. The advantage of creating this type of materialized view is that expensive joins will be precalculated.
    Fast refresh for a materialized view containing only joins is possible after any type of DML to the base tables (direct-path or conventional INSERT, UPDATE, or DELETE).
    A materialized view containing only joins can be defined to be refreshed ON COMMIT or ON DEMAND. If it is ON COMMIT, the refresh is performed at commit time of the transaction that does DML on the materialized view's detail table.
    If you specify REFRESH FAST, Oracle performs further verification of the query definition to ensure that fast refresh can be performed if any of the detail tables change. These additional checks are:
    A materialized view log must be present for each detail table unless the table supports PCT. Also, when a materialized view log is required, the ROWID column must be present in each materialized view log.
    The rowids of all the detail tables must appear in the SELECT list of the materialized view query definition.
    If some of these restrictions are not met, you can create the materialized view as REFRESH FORCE to take advantage of fast refresh when it is possible. If one of the tables did not meet all of the criteria, but the other tables did, the materialized view would still be fast refreshable with respect to the other tables for which all the criteria are met.

  • How to update two tables with trigger

    Hi:
    how to update two tables with trigger ?
    I have two tables :
    (1)ASIA
    MI number;
    (2)ASIA_P
    ID number;
    When I insert a new value into the asia.MI ,I also can
    insert the same value into the asia_p.id field.
    I have write a trigger as follows but it does't work.
    create or replace trigger MI_TRG
    before insert on asia
    for each row
    declare
    seq number;
    begin
    select MI_SEQ.Nextval into seq from dual;
    :new.MI:=seq;
    insert into ASIA_PRO(MI_ID)
    values
    (seq);
    end MI_TRG;
    How to realize it ?
    thanks
    zzm

    Why do you say it does not work?

  • How to compare two rows from two table with different data

    how to compare two rows from two table with different data
    e.g.
    Table 1
    ID   DESC
    1     aaa
    2     bbb
    3     ccc
    Table 2
    ID   DESC
    1     aaa
    2     xxx
    3     ccc
    Result
    2

    Create
    table tab1(ID
    int ,DE char(10))
    Create
    table tab2(ID
    int ,DE char(10))
    Insert
    into tab1 Values
    (1,'aaa')
    Insert
    into tab1  Values
    (2,'bbb')
    Insert
    into tab1 Values(3,'ccc')
    Insert
    into tab1 Values(4,'dfe')
    Insert
    into tab2 Values
    (1,'aaa')
    Insert
    into tab2  Values
    (2,'xx')
    Insert
    into tab2 Values(3,'ccc')
    Insert
    into tab2 Values(6,'wdr')
    SELECT 
    tab1.ID,tab2.ID
    As T2 from tab1
    FULL
    join tab2 on tab1.ID
    = tab2.ID  
    WHERE
    BINARY_CHECKSUM(tab1.ID,tab1.DE)
    <> BINARY_CHECKSUM(tab2.ID,tab2.DE)
    OR tab1.ID
    IS NULL
    OR 
    tab2.ID IS
    NULL
    ID column considered as a primary Key
    Apart from different record,Above query populate missing record in both tables.
    Result Set
    ID ID 
    2  2
    4 NULL
    NULL 6
    ganeshk

  • Cartesian of data from two tables with no matching columns

    Hello,
    I was wondering – what’s the best way to create a Cartesian of data from two tables with no matching columns in such a way, so that there will be only a single SQL query generated?
    I am thinking about something like:
    for $COUNTRY in ns0: COUNTRY ()
    for $PROD in ns1:PROD()
    return <Results>
         <COUNTRY> {fn:data($COUNTRY/COUNTRY_NAME)} </COUNTRY>
         <PROD> {fn:data($PROD/PROD_NAME)} </PROD>
    </Results>
    And the expected result is combination of all COUNTRY_NAMEs with all PROD_NAMEs.
    What I’ve noticed when checking query plan is that DSP will execute two queries to have the results – one for COUNTRY_NAME and another one for PROD_NAME. Which in general results in not the best performance ;-)
    What I’ve noticed also is that when I add something like:
    where COUNTRY_NAME != PROD_NAME
    everything is ok and there is only one query created (it's red in the Query plan, but still it's ok from my pov). Still it looks to me more like a workaround, not a real best approach. I may be wrong though...
    So the question is – what’s the suggested approach for such queries?
    Thanks,
    Leszek
    Edited by xnts at 11/19/2007 10:54 AM

    Which in general results in not the best performanceI disagree. Only for two tables with very few rows, would a single sql statement give better performance.
    Suppose there are 10,000 rows in each table - the cross-product will result in 100 million rows. Sounds like a bad idea. For this reason, DSP will not push a cross-product to a database. It will get the rows from each table in separate sql statements (retrieving only 20,000 rows) and then produce the cross-product itself.
    If you want to execute sql with cross-products, you can create a sql-statement based dataservice. I recommend against doing so.

  • How to match columns of two tables with

    Hello:
    I've two tables like below:
    Table1:(Base Table)
    Country|Prefix|Prefix_Length
    CountryA|001|3
    CountryB|0012|4
    CountryC|00443|5
    CountryD|0091|4
    Table2:(Detail Table)
    Population|Area|Prefix
    500|AreaA|0015921
    1000|AreaB|00122
    400|AreaC|00443743
    300|AreaD|0091333
    100|AreaA|001
    I need to match these two tables with prefix column (which length is not fixed in both tables: but it starts with 00 in both tables). Two different countries prefix can be similar up to a certain length. So, Prefix_Length can be used to determine (exactly) how long should be taken to search from Table2.
    Output:
    Country|Prefix|Area|Population
    CountryA|001|AreaA|600
    CountryB|0012|AreaB|1000
    CountryC|00443|AreaC|400
    CountryD|0091|AreaD|300
    Please help me with your valuable feedback.
    -Tanvir

    You have to explain how CountryA population is calculated:
    with base_table as (
                        select 'CountryA' country,'001' prefix,3 prefix_length from dual union all
                        select 'CountryB','0012',4 from dual union all
                        select 'CountryC','00443',5 from dual union all
                        select 'CountryD','0091',4 from dual
       detail_table as (
                        select 500 population,'AreaA' area,'0015921' prefix from dual union all
                        select 1000,'AreaB','00122' from dual union all
                        select 400,'AreaC','00443743' from dual union all
                        select 300,'AreaD','0091333' from dual union all
                        select 100,'AreaA','001' from dual
    -- end of on-the-fly data sample
    select  country,
            b.prefix,
            area,
            population
      from  base_table b,
            detail_table d
      where b.prefix = substr(d.prefix,1,prefix_length)
    COUNTRY  PREFI AREA  POPULATION
    CountryA 001   AreaA        500
    CountryA 001   AreaB       1000
    CountryA 001   AreaA        100
    CountryB 0012  AreaB       1000
    CountryC 00443 AreaC        400
    CountryD 0091  AreaD        300
    6 rows selected.
    SQL> SY.

  • How to give relationship between two tables with comon column with between oprator

    Hi Folks,
    I am using Sql Server 2008R2. I am getting a problem to establish relationship between two tables. 
    I have two Tables, 1.Inventory Details Table another one is Inventory Header Table.
    Inventory Details Table having a column Card No and inventory Header Table having columns  From card No and To Card No.
    I want to give relationship between these two tables with Card no. Could you please provide me the Sql Query.
    Your help would be greatly appreciated .
    Regards
    hasthi.
    email:[email protected]

    Hi Raju,
     We have two way that we can relate to the table either join or quality condition use following syntax/Query  for relating two tables 
    select * from Inventory_Details ID inner join  Inventory_Header IH on ID.CardNo between IH.FrmCardno and IH.ToCardNo
    or 
    Select * from  Inventory_Details ID ,Inventory_Header IH where ID.CardNo=IH.CardNo OrSelect * from  Inventory_Details ID ,Inventory_Header IH where ID.CardNo between IH.FrmCardno and IH.ToCardNo
    Hope this will help you 
    Niraj Sevalkar

  • Table - populate one table with data from the list of another table

    Hello All,
    I am a newbie in Swing and am a book and few tutorials old.
    I am trying to achieve the following:
    (1) I populate Table1 (a JTable) with a list of data - each row consists of several columns. And I have a Table2 (also JTable) that is in the beginning empty.
    Both the tables (Table1 and Table2) are showed in the window.
    (2) Lets say, there's a button (JButton) in between the two tables.
    Now if I Select a row from Table1 and press the button, this row will be sent/copied to Table2.
    And this way I can choose different rows and pass the data to Table2.
    I have manages to make Table1 and put data in it ... but for the rest, I don't know where and how to begin.
    Would appreciate some ideas and tips.
    Thank you.

    Since you are using a button to start the copy process you don't need to worry about a ListSelectionListener or a MouseListener. You need to create a button with an ActionListener that does the following:
    a) Create an Array based on the size of the number of columns in the table
    b) get the index of the selected row
    c) populate the Array with data from the TableModel by using the table.getModel().getValueAt(...) method for each
    d) Now you can add the row of data to the other JTable by updating its model.
    DefaultTableModel model2 = (DefaultTableModel)table2.getMode();
    model.addRow( theArray );

  • Union two tables with diffrent count of fields with null and float value

    Hello,
    i want to union two tables, first one with 3 fields and second one with 4 fields (diffrent count of fields).
    I can add null value at end of first select but it does not work with float values in second table. Value form second table is convert to integer.
    For example:
    select null v1 from sessions
    union
    select 0.05 v1 from sessions
    result is set of null and 0 value.
    As workaround i can type:
    select null+0.0 v1 from sessions
    union
    select 0.05 v1 from sessions
    or simple change select's order.
    Is any better/proper way to do this? Can I somehow set float field type in first select?
    Best regards,
    Lukasz.
    WIN XP, MAXDB 7.6.03

    Hi Lukasz,
    in a UNION statement the first statement defines the structure (number, names and types of fields) of the resultset.
    Therefore you have to define a FLOAT field in the first SELECT statement in order to avoid conversion to VARCHAR.
    Be aware that NULL and 0.0 are not the same thus NULL+0.0 does not equal NULL.
    In fact NULL cannot equal to any number or character value at all.
    BTW: you may want to use UNION ALL to avoid the search and removal of duplicates - looks like your datasets won't contain duplicates anyhow...
    Regards,
    Lars

  • Joining Two Tables with a DISTINCT column value

    I have two tables I need to join, but the 'left' table I only need DISTINCT for a column.
    create table t1
      bid  number(8),
      b_number number(8),
      dset varchar2(20),
      misc varchar2(20)
    create table t2
      cid  number(8),
      track number(8)
    select bid, cid
    from   ( select bid, b_number
                from   t1
                where dset = 'ABC1234'
                and    misc = 'TEXT'
             ) x,
             ( select cid, track
               from t2
               where exists ( select 1 from t2 where t2.track = t1.b_number )
             ) z
    where x.b_number = z.trackI only need records with DISTINCT cid values, but I keep getting multiple instanced of cid.
    Any suggestions?
    Thanks!

    Maybe this?
    select distinct cid
    from t2
    where track in
    select b_number
    from t1
    where dset = 'ABC1234'
    and misc = 'TEXT'
    )

  • How to use common object from two tables with out join.

    HI,
    I have two tables called A & B In A table i have the following objects
    1.weekend
    2.S1(measure)
    3.S2(measure)
    4.S3(measure)
    5.S4(measure)
    And In B table i have followning columns
    1.week end
    2.p1(measure)
    3.p2(measure)
    4.p3(measure)
    5.p4(measure)
    Now in universe i created all the measure objects i.e.s1,s2,s3,s4,p1,p2,p3,p4 A.weekend,B.weekend.
    instead of using week end two times i wnt to use only once because this is common in both table.
    if i use join between these tables i am getting values fine
    But With out join is there any thing to do in universe level to create common objects to use from both the tables..I tried using aggregate awareness but while reporting it is taking as two SQL.which is not synchronized.
    Please help me on this ...

    hi,
    Although  Weekend column is present in both tables, by creating a single Object in Universe, Universe can identify relationship with only table referenced in Object Creation.
    So, there will be no identification of relationship with other table measures.
    Obviously, you need to create 2 Weekend objects in Universe (in two classes).
    Case 1: You need not join these two tables in Universe. When you create 2 Queries in WEBI, automatcially Weekend objects are synchronized (if both are of same datatype)
    Case 2: If you join these two tables in Universe, Obviously,
    your SQL may contain Weekend from Table1, measures from Table 2
    or
    your SQL may contain Weekend from Table2, measures from Table 1
    Finally, You need to create 2 objects in Universe. But your query may contain a single Object based on Case 2.
    Regards,
    Vamsee

  • Joining two tables with different DB

    Hi
    We have 2 sources DB2 and Oracle.
    In DB2 we have two tables which stores.
    Tbl1
    Case_no     Information1     Information2     Information3
    11112     sddf     asd     null null
    11113     asd     asd     null null
    Tbl2
    Inf     Info1     Code     Info3
    Xedy     Asdf     111     afder
    Mad     Tag     123     top
    The above tables are complex join with this condition
    Tbl1.case_no=Tbl1.case_no.
    Oracle tbl
    Code     Code_desc
    111     Very good
    123     bad
    My requirement is to join the tbl2 with Oracle tbl. Based on the codes in DB2 table I should display the Code_desc in my reports. Like this
    Case_no     Code     Code_desc
    11112     111     Very good
    11113     123     bad
    But I am getting the Cartesian result.
    Case_no     Code     Code_desc
    11112     111     Very good
    11112     123     bad
    11113     111     Very good
    11113     123     bad
    Please help to resolve.
    Regards
    MD

    Select Oracletbl and tbl2, right click on them open physical diagram, selected objects. In the physical diagram page Create a join between Oracletbl and tbl2 with the condition code=code.
    In business model create a complex join between these two. Now reload metadata/restart services check output.
    Let me know if this does not work you.

  • Joining tables with "similar" field values

    I have run into a situation where I want to join two tables on a field called U_LotusBox.    In my main table the the feild can contain values like 1 or 2 or 3 or 1,2,3,4.  That's 1 comma 2 comma 3 comma 4.  My field in the second tables contains only single digit values, like 1 ,2, 3 up to 5.
    When the two fields are identical I am able to retrieve data.  But if my field in the main contains a value of 1,2,3 and my secondary table field value is 2 I get no data returned because the two fields are not identical.  
    Is it possible to have a join that is "fuzzy" meaning that if the main table field values contains the value of the secondary field value, 2 in my example would it be possible to return data?
    Any thoughts would be appreciated.

    Ralph,
    Here in high-level details is an SQL example of creating two tables (test1 and test2) with one column in each table (col_a and col_b, respectively) to show how a join on a substring of one column can be tied to a column of another table:
    create table test1 (col_a char(5))
    create table test2 (col_b char(1))
    insert into test1 values ('1')
    insert into test1 values ('1,2,3')
    insert into test2 values ('1')
    insert into test2 values ('2')
    select col_a,test2_tbl1.col_b
    from test1 inner join test2 as test2_tbl1 on col_a=test2_tbl1.col_b or
    substring(col_a,1,1)=test2_tbl1.col_b or
    substring(col_a,3,1)=test2_tbl1.col_b or
    substring(col_a,5,1)=test2_tbl1.col_b
    col_a     col_b
    ~~~~~~~|~~~~~
    1         1
    1,2,3     1
    1,2,3     2
    thanks,
    John

Maybe you are looking for

  • When MRP run through background process in MDBT open PR and PO not comming?

    Hi, When MRP run through backgroung process in MDBT open PR and PO not coming in MDBT result. Pls advise accordingaly. Regards rk

  • Using iMovie scrambles my display

    Hey guys Using iMovie 10 for more than 10 mins leads to it scrambling my screen/display. I have to reboot to get it back to normal, does anyone have a fix for this or know why it's happening? Mac: 24" iMac Mid 2007 (2.4 GHz Intel Core 2 Duo model) iM

  • Missing subvi in vi.llb

    Stand alone EXE creation issue : My main application (a.vi) call the another (b.vi)VI  controls in 'Call by reference' Method. The application works fine in development computer.  When creating the exe and executing in the same development system the

  • JDeveloper as Rich Client Platform?

    Hello, is it possible to remove all default extensions in Developer or SQL Developer and only use custom extensions? This means, is it possible to do something similar to the Eclipse Rich Client Platform? Has someone already tried this ? kind regards

  • When I click on my iTunes icon, it highlights but does not open.

    I can't open iTunes and haven't been able to for a couple days now. I can't find any solutions anywhere. Does anyone know a way to fix this?