Combine Queries in one workbook

Hi guys,
I am looking for a way to combine multiple queries in one workbook.
For example: If I set a filter in one query to the month November, the same filter (e.g. November) should apply to all other queries (which are on another worksheet or on the same worksheet).
How can I do this?
Many thanks,
Sabin

Hi Sabine,
You have two options:
1.  the easy one is to use same variables in the refresh screen for all queries in the same workbook; if you do this, then use the "refresh all queries" option, you will get the same restrictions applying to all queries in the workbook simultaneously.
2.  the more difficult way to do this is to use a lot of Visual Basic.  Using Visual Basic, you can "read" the filter value set on a particular query, then "apply" that filter value to every other query in the workbook.  OR, you can use the "Copy Filter Value" function.  I prefer the latter for a number of reasons.
From your earlier notes, I assume you want to use option 2.  To help you further, it would be useful to know what version of BW you are using, and how your users typically refresh queries (i.e., with a button in the workbook, or using the Business Explorer toolbar?).
It would also be helpful to know your level of comfort with VBA in Excel.
Here are some notes on the "Copy Filter Value" function:
Function SAPBEXcopyFilterValue(fromCell As Range, Optional atCell As Range) As Integer
• Return value of zero indicates that no errors were encountered.  Otherwise, function returns number of errors encountered.
• If atCell is not specified, the active cell is used to determine which characteristic to return information for.  If the active cell is not part of a query definition, then function returns an error state.
• Characteristics (fromCell and atCell) must have same technical name; for example, cannot copy filters for Ship-to (0SHIP_TO) in Sales cube to Ship-to (YCOCUSSH) in a Shipments cube
• Queries (copying from and to) must be in same Excel Workbook.
Sub CopyFilterOnce()
Dim filterRng1 As Range, filterRng2 As Range
    'in this example, we are copying filters from query on sheet
    'with code name Query1 to query on sheet with code name Query2
    Set filterRng1 = Query1.Range("F10")
    Set filterRng2 = Query2.Range("D13")       
    retVal = Run("SAPBEX.xla!SAPBEXcopyFilterValue", filterRng1, filterRng2
End Sub
Hope this helps.
- Pete

Similar Messages

  • Max. number of queries in one workbook

    Hello experts,
    is there a mximum number of queries which can be embedded in one workbook?
    What are the disadvantages of using many queries in one workbook.
    Are there other disadvantages for input ready queries?
    Thank you
    Johannes

    Johannes, to follow up on Rakesh' answer, your performance will depend on the amount of data you are pulling out with the queries.
    as for the additional disadvantages - unless you use the BExGetData formula, formatting will be your primary issue.  Also, when you create buttons for the input ready query, the only time you get to set what Data Provider you are using is when you first code the button.   After that, you would need to recreate the button to ensure that you are pointing to the right query.
    the advantages are that you can model your reporting requirements any way you want (for example we use two multiproviders with different characteristics and use 6 queries to pull the data out)
    Pavel

  • Two Queries In One Workbook With Calculations

    Hi Guys,
    Can you have 2 queries in one worksheet, either ran as a query or save as a workbook and calculation done at runtime.  For example, query A and query B to show up in one sheet when you run query A.  You now want a simple calculation done......for example.......A1 row from query A divided by B1 row from query B.  The result to show up on the Key Figure structure in query A.
    Thanks,
    Recca
    Edited by: Recca Recca on Jul 11, 2011 4:45 PM

    Hi,
    I am not sure about this but we had similar kind of requirement and what we did was,
    One query in one tab, another query on second tab and we did key figure calculations on third tab of the workbook eg. Sheet1 A1 - Sheet2-A1 and the result was stored on sheet3.
    We saved the workbook and used to refresh the same whenever we want to see new data.
    Regards,
    Durgesh.

  • How to save 2 queries in 1 workbook

    Hi experts,
    could you tell me in steps how to save two queries in one workbook.
    Regards.
    harry

    Hi Harry,
        After creating a query you can execute the query. Once the result is displayed you have the option of saving it as a workbook. using that you can save it as workbook. Once it is saved as workbook you can run it and the result is displayed in one sheet. Go to another sheet and use the option insert query in the workbook to insert new query. So you will have a workbook with 2 queries now. Futher if youwant to interpret the data of the 2 queries ina fresh sheet in the same workbook you can use cell references and hide the other 2 sheets.
    i hope this will help you.

  • Insert multiple queries using either WORKBOOK, WAD or Report Designer

    Hello Guys
    I have a task where I have to insert multiple queries into one single page/sheet & print it out later. For this I can use any one of the tools available: Workbook, WAD or Report Designer.
    1. Workbook - Here I have read that we can use a call back MACRO and some other features.
    2. WAD - Here I have read that we can use: 1. Multiple data providers (one for each query) & 2. Multiple web analysis items linking to each individual data provider.
    3. Report Designer - Since this is the actual 'formatting' tool provided by SAP, I am assuming that this is the right environment to achieve my task.
    My question: Which one out of the above 3 tools is actually feasible? Can someone explain me in detail about how to go about this task. Any 'How to..' docs from SAP would also be most helpful.
    Regards.

    Hi Kashyap,
    I have done similar requirement in Workbook,it has better features and more user friendly than others......it depends on the individual...but U cna meet your requirement thru Workbooks...
    If the Req are complicated then we go for MAcros ,where in we can satify the critical req,say some sort of Dynamic reqs.
    There are lot of threads on Multiple queries in one Workbook....Just search in SDN and u will get lot of Threads on this topic.
    Come bak if u have any other doubts.
    Rgds
    SVU123

  • Combining 2 Queries in a workbook .

    Hello Guys,
    I have 2 separate queries coming from different infoproviders  - one from COPA and one from FIGL.
    The end user wants to combine these 2 queries to one.
    How to do it.Can we do it in the workbook .
    The other option is creating a multi provider.
    I don't want to take that route.
    Please advise.
    Thanks
    Senthil

    HI
    first you run the report and save it in qorkbook and you can find the ioption called insert query again you select the query which you want put in the work book and then save it, if your using same variables in both the reports it will ask only once. if it is  different it will come 2screens separately for each query.
    then you can do the caluclations at cell level like excel formulas then you have to save the work book. in the properties you just select the option for refresh the both the queries when execute the work book.
    Regards,
    chandra.

  • 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

  • How to Combine two queries into One

    Hi Gurus,
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL>
    I have following two queries. How I can convert these two queries into one with the same result ?
    Q1
    SELECT id,vdate,vendorname,venddate,vid
    FROM VENDOR
    WHERE processid=32
    AND venddate is null
    AND vid in(select vid from view_vid where type='PDX')
    AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=55)
    AND (id,vdate) in (select id,vidate from market_data where marketed_date is null)
    AND id not in (select id from location)
    Q2
    SELECT id,vdate,vendorname,venddate,vid
    FROM VENDOR
    WHERE processid=20
    AND venddate is null
    AND vid in(select vid from view_vid where type='PBX')
    AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=40)
    AND (id,vdate) in (select id,vidate from market_data where region_date is null)
    AND id not in (select id from location)
    I can UNION these two queries, but, is there any way I can write a single query with which gives me same result as above two queries?
    Any help would be highly appreciated
    Thanks in advance

    Hi,
    You can do something like this, which will be more efficient than a UNION:
    SELECT  id, vdate, vendorname, venddate, vid
    FROM  vendor
    WHERE  (   (    -- Conditions that apply only to q1
                               processid = 32
                AND  vid       IN (SELECT vid FROM view_vid WHERE type = 'PDX')
                AND (id,vdate) NOT IN ( SELECT id, vdate
                                        FROM   vkfl_is
                                        WHERE  task_id = 55
                AND (id,vdate) IN ( SELECT id, vidate
                                    FROM   market_data
                                    WHERE  marketed_date IS NULL
            OR  (  -- Conditions that apply only to q2
                     processid = 20
                AND  vid       IN (SELECT vid FROM view_vid WHERE type = 'PBX')
                AND (id,vdate) NOT IN ( SELECT id, vdate
                                        FROM   vkfl_is
                                        WHERE  task_id = 40
                AND (id,vdate) IN ( SELECT  id, vidate
                                    FROM  market_data
                                    WHERE  region_date IS NULL
                   -- The remaining conditions apply to both q1 and q2
    AND     venddate   IS NULL
    AND     id         NOT IN (SELECT id FROM location)
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Need Different Selection screen for different Queries in a Workbook

    Hi,
    I have created a workbook with Multiple tabs in BI 7.0.  Each Tab has different Queries and each query has different Selection screens (Variable Selections).
    When i open the workbook and refresh it, the selection screen is appearing only for one query.  All the queries are refreshed by this single selection screen, though each query has different Variable selections.  What i need is a seperate selection screen i.e seperate Variable selection appearing for each queries, when i refresh each one of them.
    Is it possible to do this?  If anybody has tried this, help me in solving this issue.  Thanks for ur time.
    Regards,
    Murali

    Murali,
    If you un-check the 'Display Duplicate Variables Only Once' this WILL solve your problem.
    When you Refresh, you should be presented with a single variable selection dialog box, but it should contain an area for each Query (DataProvider) that is embedded in the Workbook.
    This is the case if the queries are all on the same tab, or on different tabs.
    However, if you have multiple tabs each with a query on it, each query must have it's own DataProvider. If all queries are based on the same DataProvider, it will not work as the Workbook only 'sees' one Query for which it needs variable input.
    If you REALLY want multiple variable selection dialog boxes, then maybe the best way to do this is to have the queries in separate Workbooks.
    If you don't want the User to have to open 5 queries manually, you could use a Macro in each Workbook that runs on opening, to open the next Workbook in the sequence.
    I hope this makes sense!
    Regards
    Steve

  • How to run multiple queries in a workbook

    Hi,
    I have 3 queries in a workbook with the same variables. How can I refresh all the 3 queries when I change the variable value. It allows me to refresh only one query at a time but I need to refresh all the 3 queries at once whenever variable value changes.
    Thanks,
    Kal

    Prakash,
    Do you have any more information on where i would find the setting to;
    "Refresh individual queries within a workbook (Single DataProviderRefresh)"
    is it on the
    i) dataprovider setting
    ii) workbook setting
    iii) elsewhere?
    many thanks
    Ian

  • Queries Published to Workbook Roles

    Hello Gurus,
    I need some advice on this particular situation.
    I currently have users in our BI systems (BI 7.0) that are assigned to roles specifically for workbooks to use with the BEX analyzer. In this case there are users who can publish queries to workbooks for anyone to use (as long as they're assigned to the workbook role).
    Note:  To be specific, our business users do not create queries in production, but simply create a view of an existing query and make changes based on their specific need, which then can be saved to a workbook.   
    In the past we had workbook roles transported (in error) to production from development, which overwritten the queries published to the workbook in production. Updates to the workbook roles were only being made in production, so when the roles came over from DEV it wiped the queries that were created by the end users.  Iu2019m currently in the process on re-structuring the role authorization concept in our BI system and would like to incorporate workbook authorization to one role (role based security) instead of having multiple on-off roles for workbooks. Having one role means Iu2019ll need to work in DEV and push the changes to production, however with the workbook situation if any queries have been published to the one role it will be wiped every time a transport goes into production.
    I would like to the following:
    1. Is there an alternative method to running queries without utilizing workbooks?
    2. What would be the best scenario or best practice when publishing queries to workbook roles?
    Regards,
    Wes

    Wes:
    User cannot see favorites of another user in BEx Analyzer.
    Instead of saving a workbook to the role and risk having it overwritten the next time the role is transported, your users could save their changes as a view ('save view global' option).  They will not be prompted to save as a favorite or in a role - it inherits whatever role the query is in and will not be overwritten if that role is transported.
    Keep in mind that things like query properties set in the view are not retained like they are with a workbook, however.  The view stores the navigation state, variable values, etc.
    Hope this helps...
    Regards,
    Kerry

  • 2 Queries within 1 workbook in BEx BI7.0

    Hi Experts,
    I know that there is a new method of creating a workbooks in BI7.0 using the Design Mode.
    Suppose I have put 2 queries within 1 sheet in excel (one on top of the other). I did this by inserting 2 analysis grids within the same worksheet.
    When I try to drill down the query on top, the area it occupies expands and completely overwrites the query at the bottom.  As such, the bottom query disappears.
    Is there a setting somewhere which will make the system adjust the position of the query at the bottom in this scenario?
    I remember that with 3.x, when you insert 2 queries within the same worksheet in the workbook and you try to do a drilldown, the system would ask if you want it to overwrite or adjust the affected query area.
    I am trying to look for the same functionality in BI7.0 workbook creation.
    Thanks for your help in advance.
    Emelee

    Some leads..
    Multiple queries in a workbook
    Multiple queries on same sheet
    Hope it Helps
    Chetan
    @CP..

  • Combined Queries

    Hi
    I have a query regarding combined queries. I am using BO XI R2 Deski. When i create combined queries, i have observed that BO is processing theses queries in the order from right to left i.e it is executing the last two queries first and then then the next right most and so on...
    For example if i want to calculate (A Union B) minus  (C Intersection D). I am unable to frame this query. When i see the SQL the order is different. Please advise how can i set this preference like first calculate ( A Union B) and ( C Intersection D) and then subtract bothe the result sets.
    Thanks,
    Raveendra

    Hi Raveendra,
    I Tried and able to perform operation Separately like (A union B) and (C Intersection D) and also succeed to put the result side by side but not able to succeed in finding the Minus of the results. Because as you said DESKI perform operations from left to right  for each combined query.
    I performed union and Intersection operations separately by using 2 data providers.
    I used demo universe eFashion  for union and intersection.
    The Steps followed are as follows:
    1. Select eFashion Take objects Year, Store Name, Sales revenue
    2. Click Combine Queries and Take same objects because Union operation requires both queries Must have have same objects.
    3. Union these 2 Queries Run The Report you will get the Union of 2 Queries. (A Union B)
    4.Select New Data Provider (Data New Data Provider)
    5. Select Universe you want  Take objects in Query C, I Took Same objects with different condition like (Year Inlist(2002,2003))
    6. Query D with Condition (Year Equalto(2002)) you will get Results (Query C intersection D). Results that contain only Year Equal to 2002.
    Now you have objects from 2 data providers together, Drag and Drop Objects from 2 data providers and put them at different places on Report now you can compare the results.
    Here we canu2019t Minus the results because when you click Edit Data Provider, DESKI will Prompt you to select the data provider to Edit and hence we can perform edit operation on One data provider one at a time and not together.
    I Hope this is useful.
    Thanksu2026
    Pratik

  • Different variable values for same query inserted 6 times in One workbook.

    Hi,
    We have one workbook with the same query inserted on 6 different tabs (sheets in excel), a variable on Business Unit that is different for each tab.
    How can we control the variable input in BW2004s such that the different BU values are processed for each tab.
    At present the BU value input in the "variable pop-up screen" over rides all the fixed variables on the different tabs.
    Generous points will be awarded for useful solution.
    Thanks,
    Jasmine

    Hi,
    I am  trying to use filters for executing 2 queries in a Web App. I have 2 dataproviders (one for each query), and I am trying to use filters for say Version.
    The URL is
    /sap/bw/BEx?cmd=ldoc&TEMPLATE_ID=ZTW_XXX&DATA_PROVIDER_1= DP1&FILTER_IOBJNM_1=0VERSION&FILTER_VALUE_1=F01&DATA_PROVIDER_2= DP2&FILTER_IOBJNM_2=0VERSION&FILTER_VALUE_2=F02.
    This doesnot work. Both queries get filtered on both 'F01' and 'F02'.
    I am trying to filter DP1 by F01 and DP2 by F02.
    Any help is appreciated.
    Thanks,
    NS

  • Parallel Refresh queries in a workbook with BI7.0

    Hi Experts,
    could somone tell me if is it possible to refresh IN PARALLEL all the queries in a workbook with 7.0 version? are there any differences from 3.5 Bex version from this point of view?
    This kind of option would be  very usefull for long run queries and/or big ammount of queries collected  in a workbook.
    I would be really grateful if you can give me link to documentation on this point.
    Thanks very much
    Best Regards
    Filippo Corvi

    Hi
    You are correct, if we put the big queries in a workbook it would be a performance issue.
    I have to check the option of refreshing the queries parallely.
    But you can try one option, the workbooks are also refreshed in Precalculation Server. If you can schedule that then the users would not have a problem.  May be I am wrong in this option. But it would be like refreshing the statistics before using them.
    If you can tryout, this is the help
    Note 936112 - Precalculation server help for troubleshooting
    Also this is one more option, but I had not tried out
    Schedule a Refresh of BEx Workbooks

Maybe you are looking for

  • Angry with itunes10. will no longer purchase songs from itunes.

    I have bought so many songs off itunes It won't let me burn any of them onto a cd since updating to itunes10 So i try putting it own windows media player. it won't let me do that. So then i try burning it on a cd it won't let me do that either. I've

  • Nokia N95 (CAN'T ABLE TO BROWSE WAP IN 3G)

    Dear Experts, i am facing a problem in 3G service in NOKIA N95. i am having the service of 3G when i will connect the internet via WAP it will connect but i cannot able to browse or open any web page and if i will discoonect the wap and try to connec

  • Change of Output

    Hi..I have the query, While running the transaction Mb5T, I  want to display the output of MB5T default in the detail list. But As of now it is showing the output with header and Item level detail. there is a  field Layout in the Selction screen of M

  • My dv6120us laptop boots, but the fan (which works in another computer) does not come on...

    I have a dv6120us laptop that I am having fan troubles with. I don't have an OS loaded but the CoA is for XP media center edition. The computer boots up and can access the bios if necessary, but the CPU cooling fan never kicks on. I have pulled it ou

  • Not getting response in soap ui after cache refresh

    Hi Experts,       I have a scenario SOAP- PI-RFC Synchronous scenario. when we are trying to send message in  SOAP UI nothing is coming to PI and its showing blank in soap UI . Before doing cache refresh all interfaces were working fine in QA but aft