Linking two queries

I am having trouble linking two queries in my data table. The first query finds the maximum of a certain set of information, has the breakorder set at asending and orders them by a set of numbers in that query. A coordinate (ie. x and y) field is based off this maximum. In the other query, another maximum and coordinate are found and should be ordered by the same thing as in the first query (set of number in asending order). Instead of this happening, it prints all the numbers (not just the max) and the cooresponding coordinates for that number. I think that it has something to do with the queries not being linked properly. I would like to figure out what and where to link these queries (the whole report is based off a common id number).
Thanks!

If you're getting everything (as opposed to just the maximum) then I would suspect that it's your where clauses, or groupings, that are at fault (select max(x), y from <table> group by y should only return one row per y).
However, it's pretty hard to determine what's going on with your descriptions - could you provide a couple of simplified queries and describe how they're linked, and it might be easier for everyone to figure out what's going on.
Thanks,
Danny

Similar Messages

  • Linking two Queries but the values are corrupted

    I have started linking two queries from the same Cube.  The invoiced value from the pre-query shows the correct value from SAP.  When I use this prequery into another query and look at the same invoiced value key figure, the result has changed and is not correct anymore.  Please advise what I am doing wrong.
    Any help would be most appreciated.
    Ray

    Hi Bhanu, the replacement path is on the Dimension Sales Document.  I have tried to use the same variable on the Key Figure Net Value (Invoice).  I also tried for a later attempt to use a different Key Figure in the prequery as net weight, just in case they added together.
    Am I right that I should be using the same key figure Net Value (Invoice) in both queries?
    Thanks
    Ray

  • Linking two queries in Data Template

    All,
    Hoping to get a little help here. I have a basic data template and inside of it there are 2 queries. I would like to use a field from Query 1 and use it in Query 2. I have used the Bind Variable and Data Links (both work but I am getting what looks like a cartizian product). Query 1 is not a Parent-child relationship to Query 2, I simply just want to use the value of the field from Query 1 in Query 2.
    Example:
    Query 1 returns:
    5 rows of 'A'
    10 rows of 'B'
    Query 2:
    Using 'A' it returns 2 values
    Using 'B' it returns 5 values
    I want to use the value 'A' and 'B' from Query 1 in Query 2.
    Everytime I use a data link or bind variable it would return 10 rows for 'A' and 50 rows for 'B' in Query 2.
    I am not sure if there is a way to fix the queries themselves or if it would be something in the grouping logic that would handle this. When using the Bind Variables I noticed the second query(Q2) has to be inside 'G_SEQ' in order to return any data. I would prefer not to post the
    queries due to sensitive data restrictions.
    Here is the data structure I am currently using.
    <dataStructure>
    <group name="G_SEQ" source="Q1">
    <element name="MATERIAL_TYPE" value="MATERIAL_TYPE"/>
    <element name="GROUP_TYPE" value="GROUP_TYPE"/>
    <element name="COL1" value="COL1" />
    <element name="COL2" value="COL2" />
    <element name="COL3" value="COL3" />
    <element name="COL4" value="COL4" />
    <element name="COL5" value="COL5" />
    <element name="COL6" value="COL6" />
    <element name="CF_ISSUE_TO_LINE_TOTAL" value="D_COL1" function="SUM()"/>
    <element name="CP_ISS_TO_LN_TOT_LESS_10" value="D_COL1" function="SUM()"/>
    <group name="G_1" source="Q1">
    <element name="D_COL1" value="D_COL1"/>
    <element name="P_COL1" value="P_COL1"/>
    <element name="YR_PER_COL1" value="YR_PER_COL1"/>
    <element name="P_PER_COL1" value="P_PER_COL1"/>
    <element name="D_COL2" value="D_COL2"/>
    <element name="P_COL2" value="P_COL2"/>
    <element name="YR_PER_COL2" value="YR_PER_COL2"/>
    <element name="P_PER_COL2" value="P_PER_COL2"/>
    <element name="D_COL3" value="D_COL3"/>
    <element name="P_COL3" value="P_COL3"/>
    <element name="YR_PER_COL3" value="YR_PER_COL3"/>
    <element name="P_PER_COL3" value="P_PER_COL3"/>
    <element name="D_COL4" value="D_COL4"/>
    <element name="P_COL4" value="P_COL4"/>
    <element name="YR_PER_COL4" value="YR_PER_COL4"/>
    <element name="P_PER_COL4" value="P_PER_COL4"/>
    <element name="D_COL5" value="D_COL5"/>
    <element name="P_COL5" value="P_COL5"/>
    <element name="YR_PER_COL5" value="YR_PER_COL5"/>
    <element name="P_PER_COL5" value="P_PER_COL5"/>
    <element name="D_COL6" value="D_COL6"/>
    <element name="P_COL6" value="P_COL6"/>
    <element name="YR_PER_COL6" value="YR_PER_COL6"/>
    <element name="P_PER_COL6" value="P_PER_COL6"/>
    </group>
    <group name="G_SUPPLIER" source="Q2">
    <element name="supplier" value="supplier"/>
    <element name="grade" value="grade"/>
    <element name="bdft" value="bdft"/>
    <element name="part" value="part"/>
    <element name="trans_source" value="trans_source"/>
    </group>
    </group>
    </dataStructure>
    Thanks,
    Jason

    Steven thanks again for your response.
    You are correct that it will give me the correct data, though, the issue still lies in connecting the data. For example in my original question:
    Example:
    Query 1 returns:
    5 rows of 'A'
    10 rows of 'B'
    Query 2:
    Using 'A' it returns 2 values
    Using 'B' it returns 5 values
    I want to be able to display the results like this:
    Results for Query 1(A)
    Results from Query 2(A)
    Results from Query 1(B)
    Results from Query 2(B)
    or in terms of the data above
    5 rows of 'A'
    Using 'A' return the 2 values(or rows)
    10 rows of 'B'
    Using 'B' return the 5 values(or rows)
    I believe in the case you pointed out it would do the following because the first query returned 'A' and 'B':
    Results for Query 1(A)
    Results from Query 2(A)
    Results from Query 2(B)
    Results from Query 1(B)
    Results from Query 2(A)
    Results from Query 2(B)
    or in terms of the data above
    5 rows of 'A'
    Using 'A' return the 2 values(or rows)
    Using 'B' return the 5 values(or rows)
    10 rows of 'B'
    Using 'A' return the 2 values(or rows)
    Using 'B' return the 5 values(or rows)
    Thanks again for your help, it is much appreciated!
    Jason

  • OBIEE: Link Two Separate Queries Together

    Hi,
    I am trying to link two separate queries together in BIEE.
    I have a query that will give me the sales value in January 2012 (monthly query)
    But I would need to use the sales value of January 2012 to help derive the weekly sales value in another query (weekly query).
    How would you link up two queries together?
    I tried using union but it doesnt seem to be working.
    Thanks.
    Bill

    Hi Billy,
    Sure, My pleasure. Here are the basic steps what you could go through.
    1. Create an analysis with your Month (January) and Sales.
    2. Save this analysis as Report1.
    3. Create another analysis with Week and Sales.
    4. Create a filter on column:Sales using the option 'Based on Another Analysis'. The analysis editor will provide you an option to browse your other analysis which you want this analysis to be based on and just click on this browse button, and navigate to and select Report1.
    5. Once you have selected Report 1 through browse option, you get down in the same pop-up the relationship and use values in column.
    So sample entries in this pop-up might look like
    Column : Sales
    Operator : is based on results of another analysis
    Saved Analysis : /My Folder/Report1
    Relationship : is equal than
    Use values in Column : Sales
    6. If you run this analysis, you could get all weekly sales figures which are equal to the january sales figures.
    Hope this helps.
    Thank you,
    Dhar

  • Report with Two Queries -- Really need your Help Guys

    I might be posting duplicate thread but i couldnt found the Q&A that i am looking for.
    I am trying to create a report where i have to use two query. Also, with this query i am passing parameter where i ask user to enter Report Month so they can run report by what ever month they want to see data.
    Now my Q_2 is duplicate or Q_1 because in my final report layout i have to display fields where i have to compare current_month_data to Previous_month_data. so basically i want user to in put current month date and previous month date and layout look like.
    Company_Name Currentmonth_sale previousMonth_Sales ....
    Honda $1423.42 $324.42
    Toyota $3433 $4255.45
    so on....
    Now so far i create report manualy and drop two query in to the report but when i trying to create Report Wizard and group by each Company.. it is not giving me the out put that i want. Instead of giving me above out put its give me my Q_! result with each company group and then under that result i have Q_2 result.
    so HOW CAN I DISPLAY FIELDS FROM MY Q_2 WITH MY REST OF THE FIELD ON Q_1?????????????????????????
    Thank You guys.

    Actually, I tried to use Data Link but i am not able to success.
    Let me know if I am doing anything wrong . i click on left hand side tool panel where its says DATA LINK. then i click on Q_1 field and then drag the mouse over to Q_2 query with same field name. but its give me an error that Can not link it because of Group data and i have option to choose Yes, NO or Cancel.
    Let me know what are the step i need to take in order to link this two queries.
    Thank You
    keyun

  • How to combine two queries in one EXCEL

    hi i got one requirement
    i got one excel sheet  from user which contains two  report s(hoe we know whether it is worknook or not) of  2011 data and now user wants 2012 data .now i icluded jan 2012 to dec 2012 in two reports and sent to user.But user is asking these two reports want to see in one sheet.
    so how can i proceed: if i go for work  book  how can i include these two reports in workbook and here my doubt is if i create a workbook based on  these two querie which name i have to give user.Please help me out on the same.
    Regards,
    Madhu.

    Hi Madhu
    Run one query. Click on a empty space in the excel
    From the BEx Design Toolbar -
    >Insert Analysis Grid -
    > Right click on the Design Item
    Edit the DataProvider.....You can ran same or different query with selection. 
    Save the result
    Check this link for detail....I am also searching for something with screenshot
    Regards
    Anindya
    Edited by: Anindya Bose on Feb 14, 2012 3:04 AM

  • How do I connect two Queries?

    Hello all,
    How do I connect two Queries and add some numbers.
    Here is what I am trying to do.
    Query 1: Gets G/L Credit Amounts for Jan 2007  Feb 2007 March 2007.....Dec 2007
    Query 2: Gets G/L Debit Amounts for Jan 2007 Feb 2007 march 2007.....Dec 2007
    I need to put both these Queries in a worksheet one below the other and add the totals by each month.....so the final report looks something like this:
    I am using two structures to hold the query values.
    G/L Credit Amount        Jan 2007    Feb 2007.............Dec 2007
                                        +100         +200                   +400
    G/L Debit Amount           -50           -100                     -200
    Total                              50             100                      200
    Also, I would like to allow the users to enter Year as a variable. Any suggestions?
    Your help is greatly appreciated.

    Venkata,
    Thanks for your reply. Could you explain how I insert two query results into one worksheet? And, also how do I link the two structures ( one structure per query) so I can total the amounts by each month?
    Thank you in advance.

  • Linking two hierarchies

    <b>Can we link two hierarchies created in BW? </b>
    The scenario is: I have two separate hierarchies (i.e. H1 and H2). Both are in use by many queries. As per the specific requirement from my business user, I have to link H2 with H1 …means there is specific requirement in which H1 needs to have same hierarchy nodes as H2. But my user doesn’t want to maintain H2 at two separate locations. That is why we are looking if there is any solution using which we can link these two hierarchies.
    Any help will be <u><b>highly appreciated</b></u>.
    Regards,
    Kuldeep Joshi

    I appreciate your suggestion,
    But in my scenario, both hierarchies are not time-dependents and both are unbalanced. To implement your suggestion, I have to convert my hierarchies into time-dependent.
    I won’t mind to try this approach, but it would be great help to me if you could elaborate your suggestion fully.
    Thanks,
    Kuldeep Joshi

  • Aligning subtotals from two queries.........

    I have two queries in a report that are identical except for one entry in the where clause. The two queries each have four groups and are linked by a column in the first group. Both queries return the same columns and a count value. My report displays the totals of each count by group. Each query brings back the expected results however the totals per group do not line up. How do I ensure that the total for each group in both queries line up together?
    Thanks in advance
    William

    Did you check both are same data type and doesn't have trailer spaces for either values?

  • Linking two different query created in SQVI

    Hi friends
    1) How to link two different queries created in SQVI
    The output of the first query will  the input of the second query
    for example i have created one query to extract the material documents, now i want to pass this material documnts into the second query for serial number extraction
    2) Is is possible to use a particular table twice in a single query,  I am getting the error that Table already used
    Regards
    Amuthan M

    Try Table joins, Take help of technical persons

  • Inserting two queries in a single Sheet

    Hi GURUS,
    I have a requirement in reporting. The user needs two queries in one report.
    I have two separate queries and user wants those two queries combined.
    I mean when the user execute a report, then he want to see his both queries in one sheet. Is that possible???
    If yes then plase explain me in detail how do ? do that. Will definitely assign points. Thanks in advance.

    Hi Suresh,
    Thanks for your quick response. Your links helped me but it says:
    You can execute 2 queries in one work book.First execute one query,place the cursor under query results area,go to tools->Insert query->execute.Save->Save existing work book.
    But I am unable to find the option Insert Query in the Workbook Bex Tool bar. Please let me know where this option is available in BEx in BI 7.0.

  • Joining two queries with Visual Composer

    Hallo,
    I was working with visual composer to join two queries with the distinct operator. But on my table view, when i linked it with the distinct operator, i get only the key element customer (customer, customer_ext_key, customer_key). These are the queries that i want join:
    Query 1:
    Customer
    Net Sales
    Query 2:
    Customer
    Billed Quantity
    What i want to see is the following result:
    Customer
    Net Sales
    Billed Quantity
    Can anybody help me with this problem?
    Greeting,
    Murat.

    Hallo,
    I was working with visual composer to join two queries with the distinct operator. But on my table view, when i linked it with the distinct operator, i get only the key element customer (customer, customer_ext_key, customer_key). These are the queries that i want join:
    Query 1:
    Customer
    Net Sales
    Query 2:
    Customer
    Billed Quantity
    What i want to see is the following result:
    Customer
    Net Sales
    Billed Quantity
    Can anybody help me with this problem?
    Greeting,
    Murat.

  • Combining two queries in one..

    Hi,
    Can someone tell me how to combine follwoing two queries in one so that it will increase performance..
    SELECT single PLNNR from AFKO
           into T1
           WHERE AUFNR = '007200000100'.
    SELECT single STATU from PLKO
           into T2
           WHERE PLNNR = T1.

    using subqueries it is possible
    select single statu from plko into t2 where plnnr in (select single plnnr from afko where aufnr eq '007200000100').
    read about subqueries at this link...
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/dc7614099b11d295320000e8353423/frameset.htm
    regards,
    PJ

  • Issue in displaying two queries in the Excel

    Hi,
    as per the requirment, I have to keep two queries in the single excel.
    Can u please let me know
    1. how to do this.
    2. If one query has a free characterstic, and if I drilldown what will happen to the display values as the next cell may contain the second query.
    Thanks  in advance
    Ananya

    Hi,
    this cant be achived in Bex reporting ...
    the only possible way is to do in WAD reporting
    WAD is a platform where you can fetch the reports from more than one Bex query.
    when designing the WAD report use diffrent tables with diffrent infoprovider
    for example
    you have report 1 , report 2 and report 3
    when you drag single table and link all the three reports the Out put will be Report1 report2 Report3( with the same infoprovider)
    when you Drag three diffrent tables for Report 1 , Report 2 and Report3 with three diffrent infoprovider the out put will be
    Report1
    Report2
    Report 3 so the all the three reports will be placed one below the other
    holpe this helps
    Thanks & Regards,
    Ravi.

  • Linking two ODS objects using a multiprovider

    Hello Gurus,
    I need to link two ODS objects and both are having 3 common characteristics and the relationship between the two objects are one to many.
    My questions would be....
    1)When the relationship is one to many can I set it up in the multiprovider to sum it up and show in the report?
    2)I have 5 other charaterstics that I need to report(Slice and dice) on, but these are not common ones to both ODS objects. Is it possible for the user to get the report based on these charaterstics also? Or do I need to make sure that these 5 also exist in both DOS objects?
    Thank you,
    DM

    Hi Sh,
    Thank you very much for your reply. But I have few concerns.
    1)One to many relationship will not have any effect on the data linking since the multiprovider clubs the key figures on common characteristics. I tried this on the system and it worked.
    2)The problem would be not having similar characteristics on both infoproviders. So if I want to report on the chars individually it will have a problem( Will come as non assigned values)
    But the documentation says the multiprovider supports Homogenous and Heterogeneous cases. Please refer the following link.
    http://help.sap.com/saphelp_nw04/helpdata/en/52/1ddc37a3f57a07e10000009b38f889/frameset.htm
    I am not sure what I can do now....whether to get all the characteristics in both infoproviders by enhancing the them. Or is there another way?
    And lastly the scenario I am looking at is billing and cost of goods. So I might find records in cost of goods which may not have corresponding records in billing.(There can be goods in stock which need to be billed)The problem would be the way multiprovider link records(union) so it will have all the records from both sides even if they do not correspond to each other.
    Let me know what you think.
    Cheers,
    DM

Maybe you are looking for

  • How do I open pdf docs in Safari 5.1.5?  Online suggestions have not worked.

    How do I open pdf docs in Safari 5.1.5?  Online suggestions have not worked.

  • Logon screen in SAP Easy Access

    Hi, I want to add up a new logon screen after the user logs in to the system with his sap user id and password.I want this to happend in SAP Easy Access screen. This should happen when user tries to enter any transaction in the list box or when he tr

  • Does processed date mean that my product is on it's way ho

    Now on my RMA update page it now says:[color="#33cc00">RMA was issued to customer:[color="#33cc00">?[color="#33cc00">3/5/2006 4:02:43 PM[color="#33cc00">RMA arri'ved at Creative:[color="#33cc00">?[color="#33cc00">3/20/2006[color="#33cc00">RMA was pro

  • How to chnage th user status in QM?

    Hi, I have created a user status profile in QM with 2 statuses ( INIT - initial and RCHA-results changed). Now, I have to record the results, and whenever I do so, and save the results successfully ( using a digital signature) the user status should

  • Camera jams when using in messages

    While taking a photo from within messages, either the text line doesn't disappear or half the camera face shows. The only way to "un-freeze" is to close the app, double click and close app again. This is happening most of the time, even after a hard