Referencing different columns from different groups

Hi all,
I created a formula column in a group , say g1. This formula column references in a bind reference fashion one column from g1 and another column from another group , say g2. And when I run the report then there is an error because of the external reference from group g2. So how can I reference both the two columns because I must calculate something from both of the two columns !
Thank you very much indeed.

Hi,
Here i'm facing similar problem.
I have a query Q1 which will get data in two columns p_plan, p_real. And I have another Q2 which will bring the data in two columns m_plan, m_real. Now i want to display the difference of (p_plan - m_plan) and (p_real - m_real).
Since these fields for which the diff should be calculated are present in two different groups, std error "below Frequency error is thrown.
Any advice pls

Similar Messages

  • OBIEE Group By on 2 facts and concatenated columns from different dimensions

    Hi
    I have a different kind of problem involving 2 fact tables with different dimensional attributes.
    Fact 1 has Dim Attributes ( Cust,Facility )
    Measure - Gross Amount
    Fact2 has Dim attributes (Cust,Facility and Risk Group )
    Measure : Exposure Amount
    Since we have 2 facts with different dimensions,
    to exclude the 'Risk Group' dimension column from the group by for the Fact1,
    we set the 'Gross Amount' measure to total level (Risk Group Dimension ) in contents tab.
    So the values from both the fact tables appears in the same report correctly.
    But in the same report we have another requirement where the rating column from the customer dimension has to be concatenated with the ratings column in the facility dimension.
    We have to concatenate customer.rating with the facility.rating and display it in the report.
    when we just pull the individual columns from the dimensions into the report it works fine.
    But when we try to concatenate the 2 columns and show it in the report,
    the concatenated column does not appear in the select or the group by in the SQL Fact2.( Generated by OBIEE )
    The other fact1 has the concatenated column in the select as well as the group by clause ( Generated by OBIEE )
    As a result the report shows the concatenated values only for the results from the Fact1. But the results from Fact2 does not have the concatenated column values.
    The report should look like the below:
    Custor.Name,     Customer.Id,     Facility.Name,     Facility.Id,     Customer.Rating/Facility.Rating,     Risk Group,     Gross Amount,     Exposure Amount
    ===========    =========      ===========     =========   ========================      =========     ===========     ===============
    JPMC                123                    GROSS               123               08/10                                                  LNL                    45,000               25,000
    CLAIRE               456                    NET                    456               07/10                                                  RNK                    50,000               30,000
    Thanks,
    Chandra

    As suggested you really want to move your none-aggregated fact attributes to a logical dimension (using the same physical table as the logical fact). Map this in the BMM layer as a snowflake, Place a hierarchy on this dimension with (at minimum) Total -> Detail levels, then on the other fact table you want to include in the report, set the content level on your other fact measures to the 'Total' level for your new logical Dim and it will allow them to be present in the same report.

  • Concatenate columns from different Sql queries

    Hi ,
    I have two different queries on a same table with different conditions. I cant have these conditions in a single query as the result is not what is expected. But i have few common columns and I want the results of these queries next to the common columns. Below are the two different queries ..which I want the output to be concatenated in terms of columns :
    Query 1 :
    select * from
    ( select location,facility,floor,phase, seat_type,count(seat_type) abc from sa_master_table group by location,facility,floor,phase, seat_type order by location,facility,floor,phase, seat_type)
    pivot
    (sum(abc) for seat_type in ('Cabin','PL','Regular', 'Squeeze'))
    Query 2:
    select * from
    ( select location,facility,floor,phase, seat_type,count(seat_type) xyz from sa_master_table where employee = 'Vacant' group by location,facility,floor,phase, seat_type order by location,facility,floor,phase, seat_type)
    pivot
    (sum(xyz) for seat_type in ('Cabin','PL','Regular', 'Squeeze'))
    Hoping to find some solution for this..
    Thanks!

    Hi All,
    Thanks for your replies, but sorry for all the confusion. This is the first time I am in this pl/sql forum, so wasnt clear on providing the details.
    Ok.. Here are the details which I guess would be easier to understand my requirement :
    * I am working on Oracle Application Express 3.1 and this is where I want my query to be placed.
    * My previous post above has the exact query(s) which I am trying to format as below.
    Typical Output of the query is as below :
    h5. Location     Facility Floor     Phase     Cabin     PL      Regular     Squeeze
    Location1     Facility1 Floor1 Phase1 3 5 6 10
    Once I combine the results of these query, I want the output in the below format. And this is the requirement which I am looking at :
    h6. ************************************ |Total Allocated Seats     *******************|Vacant Seats
    h5. Location     Facility     Floor     Phase | Cabin     PL     Regular Squeeze |     Cabin PL     Regular Squeeze
    Location1     Facility1     Floor1 Phase1 | 3      5     6     10 | 1     0     2     3
    Location2     Facility2 Floor2 Phase2 | 2     6     10     3 | 0     2     1     4
    Query1 give the values of 'Total Allocated Seats' and Query2 gives the values of 'Vacant Seats'. Its basically appending the resultant columns of the queries which have the same columns but values are dependent on the conditions. I have 2 more queries which got to append after Vacant seats.
    I have tried using UNION , but it actually appends the values horizontally but I want them vertically as above.
    And as rightly told by Tk, Q2 is subset of Q1 and so would be other queries.
    I tried my best to have the format appear correctly.. but still its not aligned properly. In case of queries, please get back to me.Thanks!

  • Sum two different columns from two different tables

    Can you select and sum two different columns, from two different tables in the same sql statement?
    i.e.
    table1
    Item----OnHand_Qty
    A--------10
    A--------15
    B--------10
    B--------10
    C--------20
    table2
    Item----Trx_Qty
    A--------2
    A--------4
    A--------6
    B--------1
    B--------1
    C--------4
    I'm looking for the following results from a query
    Item----Sum(Onhand_Qty)---Sum(Trx_Qty)
    A--------25

    Like this?
    SQL> create table table1 (item,onhand_qty)
      2  as
      3  select 'A', 10 from dual union all
      4  select 'A', 15 from dual union all
      5  select 'B', 10 from dual union all
      6  select 'B', 10 from dual union all
      7  select 'C', 20 from dual union all
      8  select 'D', 30 from dual
      9  /
    Tabel is aangemaakt.
    SQL> create table table2 (item, trx_qty)
      2  as
      3  select 'A', 2 from dual union all
      4  select 'A', 4 from dual union all
      5  select 'A', 6 from dual union all
      6  select 'B', 1 from dual union all
      7  select 'B', 1 from dual union all
      8  select 'C', 4 from dual union all
      9  select 'E', 3 from dual
    10  /
    Tabel is aangemaakt.
    SQL> select nvl(t1.item,t2.item) item
      2       , t1.sum_onhand_qty
      3       , t2.sum_trx_qty
      4    from ( select item, sum(onhand_qty) sum_onhand_qty
      5             from table1
      6            group by item
      7         ) t1
      8         full outer join
      9         ( select item, sum(trx_qty) sum_trx_qty
    10             from table2
    11            group by item
    12         ) t2
    13         on (t1.item = t2.item)
    14  /
    I SUM_ONHAND_QTY SUM_TRX_QTY
    A             25          12
    B             20           2
    C             20           4
    E                          3
    D             30
    5 rijen zijn geselecteerd.Regards,
    Rob.

  • How to Create a new column from two different result sets

    How to Create a new column from two different result sets, both the result set uses the different date dimensions.

    i got solutions for this is apply filters in column formula it self, based on the requirement.

  • Concatenate columns from two different reports

    In OBIEE 11g report, I am looking for a method to concatenate columns from two different reports.
    My requirement is, if I show 'Units Produced' for customer A, I need to show another column 'Units Produced' for a related customer B.
    Every customer has one related customer.
    So my report shows all the data for customer A, but I need to add one column which is for custome B , so I am looking a way to concatenate columns or if some other way this can be done

    Customer A is dimension table. You mapped to fact to get Customer A details.
    Now you want for Customer B. Now create one more alias table for Customer and name it as customer B and join with Fact on Customer B keys and use it.
    Each customer has related customer.
    2 dimension tables one for customer and other for related customer.

  • Discoverer columns from two different sheets

    Hi,
    Is it possible in discoverer to bring columns from a different sheet into another sheet? I have a few columns on sheet2, which have a different condition and sheet1 has different conditions. The sheets 1 and 2 can be linked on their emplid. Is there a way to combine the columns??
    Any help is greatly appreciated.
    Thanks!

    Hi,
    I am using decode to try and get the column with the condition into the first sheet.
    For example:
    In my first sheet, I select emplid, empl_no, area_cde, avg_eqty from table a.
    I also want the following from table a:
    1) count rec_id where a_cde in (1,2,3)
    2) count rec_id where a_cde in (1,2,3) and product_cde = 1 and discnt = 1
    When I use decode, and select the columns, I say,
    calc1:
    decode(a_cde,1,1,2,1,3,1) --> seperating a codes 1,2,3 and the rest of them.
    calc2:
    and then I calculate another item --> case when calc1 = 1 then count(rec_id) else NULL end
    When I do the above, I get one row as expected.
    However, when I try to incorporate 2), I created another calculation:
    calc3:
    case when calc1 = 1 and product_cde = 1 and discnt = 1 then count(rec_id)
    As soon as I add this calc to my report, I get 2 rows returned, because, the Avg_discnt column (just the col selected from the table, not a calc), has a discnt = 1 associated with it, and I get two rows instead of one row.
    Please let me know if posting the SQL generated by discoverer would be more clearer.
    Thanks for your inputs!
    Edited by: spriya on Apr 6, 2010 2:16 PM

  • Adding 2 columns from different queries

    Hi,
    Could someone let me know how to add 2 integer columns from 2 different queries and display it using a third field. I will need to have 2 queries.
    When I try to do it it gives me Column 'xxx' references column 'xxx', which has incompatible frequency error.
    Please need your help.

    never mind, i did it using summary columns, thanks

  • How to display data from 2 different groups in a single table

    Hi,
    Following is the requirement:
    The XML Content is below
    ListOf_ssAssetMgmtAsset>
    -<ssAssetMgmtAsset>
    <ssAccountName>1-1D09-83031</ssAccountName>
    <ssAccountPrimaryCountry>USA</ssAccountPrimaryCountry>
    <ssAssetNumber>13111027</ssAssetNumber>
    <ssNaiAssetNumber>123</ssNaiAssetNumber>
    <ssNaiGrantNumber>ABC</ssNaiGrantNumber>
    <ssNaiProductType>System Security Software</ssNaiProductType>
    <ssNaiSuperceded>123</ssNaiSuperceded>
    <ssProductDescription>Upgrade extract local DB</ssProductDescription>
    <ssProductName>1-1M5H-296</ssProductName>
    <ssStatus>ABC</ssStatus>
    <ssId>1X-ZY</ssId>
    <ssCreated>01/01/1980</ssCreated>
    <ssUpdated>01/01/1980</ssUpdated>
    <ssCreatedBy>1X-ZY</ssCreatedBy>
    <ssUpdatedBy>1X-ZY</ssUpdatedBy>
    -<ListOf_ssAgreementEntitlement>
    -<ssAgreementEntitlement>
    <ssEntitlementEndDate>16/12/2009</ssEntitlementEndDate>
    <ssEntitlementStartDate>16/11/2009</ssEntitlementStartDate>
    <ssEntitlementType>Services</ssEntitlementType>
    <ssNaiQuantity>2</ssNaiQuantity>
    </ssAgreementEntitlement>
    </ListOf_ssAgreementEntitlement>
    -<ListOf_ssAgreementEntitlement>
    -<ssAgreementEntitlement>
    <ssEntitlementEndDate>10/12/2009</ssEntitlementEndDate>
    <ssEntitlementStartDate>10/11/2009</ssEntitlementStartDate>
    <ssEntitlementType>ServicePortal</ssEntitlementType>
    <ssNaiQuantity>1</ssNaiQuantity>
    </ssAgreementEntitlement>
    </ListOf_ssAgreementEntitlement>
    </ssAssetMgmtAsset>
    </ListOf_ssAssetMgmtAsset>
    The data needs to be displayed in the below manner where first grouping is by Account Country, then by Account Name. Then the table with 9 columns where in the first 5 columns are from first group and the next 4 are from second group.
    Account Country
    Account Name
         ProductType     Grant #     Asset #     Product SKU Product Name Entitlement Type Quantity /Nodes     EntitlementStart Date     Entitlement EndDate
    I have the coding as
    first for loop: <?for-each-group:ssAssetMgmtAsset;./ssAccountPrimaryCountry?>
    second for loop: <?for-each-group:current-group();./ssAccountName?>
    third which is for the table : <?for-each:current-group()?>
    I close the above grp after product description.
    One table with the first 5 columns and below second table is placed adjacent to the first to display the 4 columns with the grp <?for-each:ssAgreementEntitlement?>
    how do I get all the 9 columns in a single row in a single table.
    Any help is appreciated.
    thanks

    What is the lnk between the two
    ssAssetMgmtAsset and ssAgreementEntitlement ?
    you want to display all the ssAgreementEntitlement for every ssAssetMgmtAsset group ?
    there shud be a link between them, you have link them and display.

  • Query to find the sum of different groups of same column

    Hi ,
    I have a table as follows:
    customers
    custid credit amt month
    001 C 2000 Jan-2012
    001 D 5000 Feb-2012
    001 C 3000 Mar-2012
    001 C 3000 Apr-2012
    001 D 7000 May-2012
    I Have to write a single query to calculate the sum of credit and sum of debit value separately.
    Thanks & Regards,
    SB2011

    Hi,
    SB2011 wrote:
    Hi ,
    I have a table as follows:
    customers
    custid credit amt month
    001 C 2000 Jan-2012
    001 D 5000 Feb-2012
    001 C 3000 Mar-2012
    001 C 3000 Apr-2012
    001 D 7000 May-2012
    I Have to write a single query to calculate the sum of credit and sum of debit value separately.Getting the sum sounds like a job for the SUM function.
    Getting separate sums for credit and debit sounds like a job for GROUP BY.
    Thanks & Regards,
    SB2011Here's one way:
    SELECT    credit
    ,       SUM (amt)     AS total
    FROM       customers
    GROUP BY  credit
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Report with non aggregated and aggregated columns from different facts.

    Hi,
    We have got requirement as follows,
    1) We have two dimension tables, and two fact(Fact1 and Fact2) table in physical.
    2) In BMM we have made hierarchies for both dimensions, and are joins both logical fact table.
    3)In fact1, we are having three measures of which we have made two as aggregation sum, and one is non aggregated(It contains character).
    4)Fact2 have two measures, both are aggregation as sum.
    5)Now here the problem arises, we want to make a report with some columns from dim and non aggrgated column from fact1 and and aggregated column fact2
    How to resolve the above issue.
    Regards,
    Ankit

    As suggested you really want to move your none-aggregated fact attributes to a logical dimension (using the same physical table as the logical fact). Map this in the BMM layer as a snowflake, Place a hierarchy on this dimension with (at minimum) Total -> Detail levels, then on the other fact table you want to include in the report, set the content level on your other fact measures to the 'Total' level for your new logical Dim and it will allow them to be present in the same report.

  • Inserting data into a column from 2 different tables

    Hi,
    I need to insert data into a table using 2 other tables. The tables that contain data have identical column names.
    Is using a UNION statement the only option?
    Also, if I need to insert data into columns from only one of the either tables, how do i do it?
    Thanks.

    For future reference, "doesn't seem to work" is a rather generic description... Posting the particular error message will be quite helpful, though I'm reasonably confident that I know the particular problem here.
    First, if only for sanity, you probably want to explicitly list the columns of the destination table in your INSERT statement.
    Second, it doesn't make sense to have DISTINCT clauses in queries that are UNION-ed together. A UNION has to do a sort to remove duplicates already.
    Third, the two queries you are UNIONing together have to return the same number of columns, with the same names, in the same order.
    You probably want something like
    INSERT INTO new_table( col1, col2, col3, col4, col5 )
      SELECT 'ABC'  col1,
             a.colA col2,
             a.colB col3,
             a.colC col4
             a.colD col5
        FROM table1 a
      UNION
      SELECT 'ABC'  col1,
             b.colA col2,
             b.colB col3,
             b.colC col4
             NULL   col5
        FROM table2 bJustin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to take a non metrics column from one fact to different subject area details level?

    I have a requirement in OBIEE ,
    I have two fact tables W_AP_INV_DIST_F and W_PURCH_COST_F. In my subject area I am using all facts from W_AP_INV_DIST_F table, But I need one more column as per client's requirement. I searched the column RELEASE_NUM found it in W_PURCH_COST_F. So I have to pull RELEASE_NUM into my subject area, which is having W_AP_INV_DIST_F and couple of dimensions.
    I have tried directly pull this column FROM W_PURCH_COST_F (physical layer), and dragged it into one dimension "Dim-AP_INVOICE_Details", here already a LTS "Fact_W_AP_INV_DIST_F" available. In Presentation layer I need to use "RELEASE_NUM" in  "Invoice Details" presentation table.
    I have doubt weather it will work or not, Will it give correct data at granular level ?
    Could you please suggest me is there any way to achieve it in OBIEE level ,without any difficulty?  Or else I have to go for ETL Changes?
    Regards,
    Sonu

    I have a requirement in OBIEE ,
    I have two fact tables W_AP_INV_DIST_F and W_PURCH_COST_F. In my subject area I am using all facts from W_AP_INV_DIST_F table, But I need one more column as per client's requirement. I searched the column RELEASE_NUM found it in W_PURCH_COST_F. So I have to pull RELEASE_NUM into my subject area, which is having W_AP_INV_DIST_F and couple of dimensions.
    I have tried directly pull this column FROM W_PURCH_COST_F (physical layer), and dragged it into one dimension "Dim-AP_INVOICE_Details", here already a LTS "Fact_W_AP_INV_DIST_F" available. In Presentation layer I need to use "RELEASE_NUM" in  "Invoice Details" presentation table.
    I have doubt weather it will work or not, Will it give correct data at granular level ?
    Could you please suggest me is there any way to achieve it in OBIEE level ,without any difficulty?  Or else I have to go for ETL Changes?
    Regards,
    Sonu

  • Will a Union handle this? Showing aggregates from different groups on the same row

    So I want to display a result that includes a sum of the transaction amount for a list of orders.  Each order can have items, and each item has a transaction amount.  
    Then I have a goal table that keeps track of the "goals" set for a simple forecasting method used by sales.  A goal is defined for each item type and a count.
    Table structures are like this
    DECLARE @OrderTran AS TABLE(RowId INT PRIMARY KEY IDENTITY(1,1) NOT NULL, OrderId INT, ItemId INT, ItemAmount DECIMAL(10,2) )
    DECLARE @GoalData AS TABLE(RowId INT PRIMARY KEY IDENTITY(1,1) NOT NULL, ItemTypeKey INT, ItemGoalCount INT )
    The problem with getting totals for both order transactions AND goals, is there there might not be items in some of the orders for the items that goals set for.  So If I grab the order totals first, then left join on goals, I still might miss out some
    of the goal results when I do an aggregate.
    Should union help here?
    In other words, get a result from the order totals
    Then get a similar result from the goals
    Then union the 2 results?

    Are you looking for something like below:
    DECLARE @OrderTran AS TABLE(RowId INT PRIMARY KEY IDENTITY(1,1) NOT NULL, OrderId INT, ItemId INT, ItemAmount DECIMAL(10,2) )
    DECLARE @GoalData AS TABLE(RowId INT PRIMARY KEY IDENTITY(1,1) NOT NULL, ItemTypeKey INT, ItemGoalCount INT )
    INSERT INTO @OrderTran
    VALUES (1, 1, 10), (2, 1, 22), (3, 2, 12), (4, 1, 50), (5, 2, 100)
    INSERT INTO @GoalData
    VALUES (1, 100), (3, 200)
    SELECT
    COALESCE(O.ItemID, G.ItemTypeKey, 0) As ItemID
    ,O.TotalAmount
    ,G.TotalGoalAmount
    FROM
    SELECT ItemId, SUM(ItemAmount) As TotalAmount
    FROM
    @OrderTran
    GROUP BY
    ItemID
    ) O
    FULL OUTER JOIN
    SELECT ItemTypeKey, SUM(ItemGoalCount) As TotalGoalAmount
    FROM
    @GoalData
    GROUP BY
    ItemTypeKey
    ) G ON O.ItemID = G.ItemTypeKey
    Output
    ItemID | TotalAmount
    | TotalGoalAmount
    1 | 82.00
    | 100
    2 | 112.00
    | NULL
    3 | NULL
    | 200
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • Columns from different tables displayed in an ADF table format

    I have a many to one relationship between 2 tables (checklist -> subcontract). I would like to display columns from each table on a web page in an ADF Read Only Table format. I created a method that returns the data I need from the tables. When I drag that method over to my page JDev I'm only allowed to select columns from either the checklist table OR the subcontract table. I need one column from the subcontract table and several columns from the checklist table. I'm using JDev 10.1.3.2 and an Oracle 11g database. Thank you in advance.
    -Wade

    Thank you for your response. I ended up creating a new getter in the Checklist table which refers to the column in the Subcontract table. Then I was able to create a table column for that returned value.
    Thanks again!
    -W

Maybe you are looking for

  • Error ocurring when trying to Backup catalog in PSE 7

    I am about to upgrade my OS and want to start fresh.  Obviously, I want to backup my PSE 7 catalog beforehand so I can restore it and not lose the thousands of tags, etc I have applied.  I have carefully followed the steps and even ran some utilities

  • How do I extract content

    I need to find a way in which to extract the content from a web site that is located in an edible region which I've named "Body." It doesn't matter if the content is extracted as an HTML file, a text file, or another form. I just need to be able to e

  • Regarding j combo box...

    hi guys i hav created a combo box...something like String [] provinces = {      "Alava", "Albacete",      "Alicante",      "Almeria" JComboBox pro = new JComboBox(provinces); now if i wan to retrieve the selected item how can i do it...i tried pro.ge

  • Time String to Timestamp Conversion Problem

    Hi, I attempted to convert time string to timestamp but I failed. What is the wrong with it? I need a timestamp to create waveforms. Egemen Solved! Go to Solution. Attachments: Time String to Timestamp.png ‏18 KB

  • Client trust for vista x64

    Hi, Does anyone know when client trust for x64 will be available. Our proxy server is not generating any log info, which our management requires, but we only have 64bit clients. thanks in advance, Marco