Xsql ... select variable to avoid multiple nested queries

Hi,
I want to have one .xsql file which processes quite a few queries.
I want to be able to save a column result from a query into something similar to a variable. That way, later in my xsql file, I can use the variable result in the where clauses of other queries.
I know I can do this with a bunch of nested queries, but it would take longer to process the results than if I could use a straight out variable from a previous query.
Anybody have ideas on how I could do this with xsql?
dgiles
null

Simplest way to do this at present is to write a custom handler that take a query and sets an attribute on the document element of the XSQL page to the value selected from the database. Then the normal {@paramname} sytnax will work to reference it's value later in the page.

Similar Messages

  • How to avoid multiple selection in ALV tree control?

    Hi,
    Experts,
    I want to avoid multiple selections on Alv tree control after pressing control keyboard button(Ctrl). Even by pressing Ctrl keyword button i want to select only one row of a Alv tree control.i have used cl_salv_tree class for it is there any method to achieve this please pass some code/idea on it.
    Thanks in advance,
    Shabeer ahmed.

    I haven't tried it before but it should help.
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01]

  • Multiple SQL Queries in SAP BPC  5.1 EVMODIFY

    Hi All,
    We have multiple SQL Queries in Outlooksoft 4.2 which extracts data from Oracle source system with different set of selections and conditions and parameters. We were able to use multiple SQL Queries in Outlooksoft 4.2 using Transform Data Flow Task and paste parameters using evModify dynamic script task, where ever extract to source system is needed.
    According to  SAP BPC 5.1, all these multiple SQL Queries and extracts by passing parameters will be coded in EVMODIFY dynamic script editor.But, EVMODIFY dynamic script editor is not working with the sets of multiple SQL Queris.It's able to recognize and execute the first SQL Query, but not able to execute from the second SQL Query.
    Does any body, did multiple extracts using SQL Queries to the source system by passing parameters using SAP BPC 5.1 data  manager and SSIS Packages, please let me know, how you did achieve the above functionality.
    Regards,
    Sreekanth.

    Hi Sorin,
    Thanks for your update, I tried declaring the variable between %%....GLOBAL(%GTIMEID%,%SELECTION%) and the package runs now but the problem is that the package is executed using the default date value for the variable GTIMEID declared in the DTSX package and its not taken the date that I'm trying to pass from BPC.  As showed below, please if you could take a look to the ModifyScript and see the last line for the global variable and line 13  PROMTP(SELECTINPUT,%SELECTION%,,,%TIME_DIM%) where I am selecting the TIMEID:
    DEBUG(ON)
    PROMPT(INFILES,,"Import file:",)
    PROMPT(TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    PROMPT(RADIOBUTTON,%CLEARDATA%,"Select the method for importing the data from the source file to the destination database",0,{"Merge data values (Imports all records, leaving all remaining records in the destination intact)","Replace && clear data values (Clears the data values for any existing records that mirror each entity/category/time combination defined in the source, then imports the source records)"},{"0","1"})
    PROMPT(RADIOBUTTON,%RUNLOGIC%,"Select whether to run default logic for stored values after importing",1,{"Yes","No"},{"1","0"})
    PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when importing data.",1,{"Yes, check for work status settings before importing","No, do not check work status settings"},{"1","0"})
    INFO(%TEMPFILE%,%TEMPPATH%%RANDOMFILE%)
    PROMPT(SELECTINPUT,%SELECTION%,,,%TIME_DIM%)
    TASK(CONVERT Task,INPUTFILE,%FILE%)
    TASK(CONVERT Task,OUTPUTFILE,%TEMPFILE%)
    TASK(CONVERT Task,CONVERSIONFILE,%TRANSFORMATION%)
    TASK(CONVERT Task,STRAPPSET,%APPSET%)
    TASK(CONVERT Task,STRAPP,%APP%)
    TASK(CONVERT Task,STRUSERNAME,%USER%)
    TASK(Dumpload Task,APPSET,%APPSET%)
    TASK(Dumpload Task,APP,%APP%)
    TASK(Dumpload Task,USER,%USER%)
    TASK(Dumpload Task,DATATRANSFERMODE,1)
    TASK(Dumpload Task,CLEARDATA,1)
    TASK(Dumpload Task,FILE,%TEMPFILE%)
    TASK(Dumpload Task,RUNTHELOGIC,1)
    TASK(Dumpload Task,CHECKLCK,1)
    GLOBAL(%GTIMEID%,%SELECTION%)
    Do you guess That I am missing something?
    Thanks in advanced
    Regards

  • How to avoid multiple call to function:

    In our datawarehouse we have a huge receipt row table where all metrics ar stored in the local currency. On top over that we have views which calculate metrics to the desired currency.
    So basically all views looks like this
    select geo_region,
    product_group,
    customer_group,
    metric1 * (select get_exchange_rate(currency_id) from dual) metric1,
    metric1 * (select get_exchange_rate(currency_id) from dual) metric2,
    metric1 * (select get_exchange_rate(currency_id) from dual) metricx,
    group by..
    As we have about 20 metrics we notices that the function is called 20 times per row.
    Is there really anyway to avoid that? Shouldn't it be it's just the exact same call with the same in-parameters over and over again.
    We've tried with local sys_context and the performance is better but the call to the context is still performed 20 times. Any Ideas?

    Can you avoid multiple function calls? Maybe, if as in your example all the function calls values are computing the same result. If they operate on different columns then you'll have to perform the function call anyway.
    Either way you should be able to eliminate the (near as I can tell) pointless subquery from dual
    You might be able to avoid the repeated function calls if the values are always the same. If every computation you could save the function call (and subquery!) by doing it once and then using assignments after the initial query using variables after the initial query, perhaps using NULL in the query as placeholders to select into a record - something like
    select inital_region,
             product_group,
             customer_group,
             metric1 * exchange_rate(currency_id) metric1,
             null metric2,
    v_metric2 := metric1;
    ...Message was edited by (fixed typo):
    riedelme

  • Crystal Report with multiple BEX queries

    I have a Crystal Report that uses 6 different BEX queries.  The report needs to display the results from each query, there is no need to join these queries.  The Crystal Report is using subreports and displaying the data one BEX query after another.
    The issue I have is that these BEX queries all have the same mandatory variable.  This is causing Crystal to prompt the user to enter the same variable filter once per BEX query.  
    If we change the BEX queries so only the first BEX query has a variable and use Crystal to filter the other 5, the performance is unacceptable.  My guess is the other 5 queries are experiencing client side filtering instead of the filter being passed down to BW.
    Is there a way to have multiple BW queries with the same variable and have Crystal only prompt the user to enter input one time?
    Thanks,
    Andy

    Hi Andy,
    My understanding of the issue is :
    --You have 6 Bex queries and are displying on after the other becaused you have inserted all these queries as sub report.
    --All your Bex queries are having same parameter / prompt / variable which will take user input and filter the data.
    --Now the report is prompting the user to enter prompt / variable 6 times.  You are looking for an option to proimpt only ones insted of 6 tiems.
    If I understood correctly follow the method to link sub reports to grab the parameter value form main report parameter :
    Right click on sub report go in Change Subreport Links, select main reort prompt / varieable and then select sub report prompt / parameter / variable.
    Do the same for all your sub reports.  This will eliminate asking / prompting the same parameter value several times.
    Thanks,
    Sastry

  • Rewriting SQL to avoid multiple scan of a table

    Hi,
    Is it possible to rewrite the following statement in order to avoid multiple scan of the tables:
    SELECT
    (ACT.ID_ACCES_CLIENT_TYPE * 100000) + 30024 ss_key,
    TO_CHAR(( SYSDATE ),'MM/DD/YYYY') date_key,
    30024 transtype_key,
    ACT.ID_ACCES_CLIENT_TYPE client_acces_d_sskey,
    T.ID_MODELE fonct_mobile_d_sskey,
    '0' type_mobile_key,
    1 MEMBER
    FROM ACCES_CLIENT_TYPE ACT, ACCES AC, TYPE_MODELE T
    where ACT.FLAG_ACTIF is not null
    and NVL(( ACT.DAT_FIN ),( SYSDATE ))> SYSDATE - ((3 + 0)*30)
    and AC.ID_ACCES = ACT.ID_ACCES
    and AC.FLAG_ACTIF is not null
    and T.TAC = AC.TAC_1
    AND mod(ACT.ID_ACCES_CLIENT_TYPE, 2) = 1
    union all
    SELECT
    (ACT.ID_ACCES_CLIENT_TYPE * 100000) + 30025 ss_key,
    TO_CHAR(( SYSDATE ),'MM/DD/YYYY') date_key,
    30025 transtype_key,
    ACT.ID_ACCES_CLIENT_TYPE client_acces_d_sskey,
    T.ID_MODELE fonct_mobile_d_sskey,
    '1' type_mobile_key,
    1 MEMBER
    FROM ACCES_CLIENT_TYPE ACT, ACCES AC, TYPE_MODELE T
    where ACT.FLAG_ACTIF is not null
    and NVL(( ACT.DAT_FIN ),( SYSDATE ))> SYSDATE - ((3 + 0)*30)
    and AC.ID_ACCES = ACT.ID_ACCES
    and AC.FLAG_ACTIF is not null
    and T.TAC = AC.TAC_U
    AND mod(ACT.ID_ACCES_CLIENT_TYPE, 2) = 1
    union all
    SELECT
    (ACT.ID_ACCES_CLIENT_TYPE * 100000) + 30026 ss_key,
    TO_CHAR(( SYSDATE ),'MM/DD/YYYY') date_key,
    30026 transtype_key,
    ACT.ID_ACCES_CLIENT_TYPE client_acces_d_sskey,
    T.ID_MODELE fonct_mobile_d_sskey,
    '2' type_mobile_key,
    1 MEMBER
    FROM ACCES_CLIENT_TYPE ACT, ACCES AC, TYPE_MODELE T
    where ACT.FLAG_ACTIF is not null
    and NVL(( ACT.DAT_FIN ),( SYSDATE ))> SYSDATE - ((3 + 0)*30)
    and AC.ID_ACCES = ACT.ID_ACCES
    and AC.FLAG_ACTIF is not null
    and T.TAC = AC.TACG_G
    AND mod(ACT.ID_ACCES_CLIENT_TYPE, 2) = 1
    Thanks for help

    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
    | 0 | SELECT STATEMENT | | 44028 | 2340K| 287K (67)|
    | 1 | UNION-ALL | | | | |
    |* 2 | HASH JOIN | | 15217 | 832K| 95835 (0)|
    | 3 | INDEX FAST FULL SCAN | TYPE_MODELE_IDX_003 | 23462 | 320K| 10 (0)|
    | 4 | NESTED LOOPS | | 15217 | 624K| 95817 (0)|
    |* 5 | TABLE ACCESS FULL | ACCES_CLIENT_TYPE | 13078 | 319K| 91239 (0)|
    |* 6 | TABLE ACCESS BY INDEX ROWID| ACCES | 1 | 17 | 2 (50)|
    |* 7 | INDEX UNIQUE SCAN | PK_ACCES | 1 | | |
    |* 8 | HASH JOIN | | 15079 | 824K| 95835 (0)|
    | 9 | INDEX FAST FULL SCAN | TYPE_MODELE_IDX_003 | 23462 | 320K| 10 (0)|
    | 10 | NESTED LOOPS | | 15079 | 618K| 95817 (0)|
    |* 11 | TABLE ACCESS FULL | ACCES_CLIENT_TYPE | 13078 | 319K| 91239 (0)|
    |* 12 | TABLE ACCESS BY INDEX ROWID| ACCES | 1 | 17 | 2 (50)|
    |* 13 | INDEX UNIQUE SCAN | PK_ACCES | 1 | | |
    |* 14 | HASH JOIN | | 13732 | 683K| 95834 (0)|
    | 15 | INDEX FAST FULL SCAN | TYPE_MODELE_IDX_003 | 23462 | 320K| 10 (0)|
    | 16 | NESTED LOOPS | | 13732 | 496K| 95817 (0)|
    |* 17 | TABLE ACCESS FULL | ACCES_CLIENT_TYPE | 13078 | 319K| 91239 (0)|
    |* 18 | TABLE ACCESS BY INDEX ROWID| ACCES | 1 | 12 | 2 (50)|
    |* 19 | INDEX UNIQUE SCAN | PK_ACCES | 1 | | |
    Predicate Information (identified by operation id):
    2 - access("T"."TAC"="AC"."TAC_1")
    5 - filter("ACT"."FLAG_ACTIF" IS NOT NULL AND
    NVL("ACT"."DAT_FIN",SYSDATE@!)>SYSDATE@!-90 AND MOD("ACT"."ID_ACCES_CLIENT_TYPE",2)=1)
    6 - filter("AC"."FLAG_ACTIF" IS NOT NULL AND "AC"."TAC_1" IS NOT NULL)
    7 - access("AC"."ID_ACCES"="ACT"."ID_ACCES")
    8 - access("T"."TAC"="AC"."TAC_U")
    11 - filter("ACT"."FLAG_ACTIF" IS NOT NULL AND
    NVL("ACT"."DAT_FIN",SYSDATE@!)>SYSDATE@!-90 AND MOD("ACT"."ID_ACCES_CLIENT_TYPE",2)=1)
    12 - filter("AC"."FLAG_ACTIF" IS NOT NULL AND "AC"."TAC_U" IS NOT NULL)
    13 - access("AC"."ID_ACCES"="ACT"."ID_ACCES")
    14 - access("T"."TAC"="AC"."TACG_G")
    17 - filter("ACT"."FLAG_ACTIF" IS NOT NULL AND
    NVL("ACT"."DAT_FIN",SYSDATE@!)>SYSDATE@!-90 AND MOD("ACT"."ID_ACCES_CLIENT_TYPE",2)=1)
    18 - filter("AC"."FLAG_ACTIF" IS NOT NULL AND "AC"."TACG_G" IS NOT NULL)
    19 - access("AC"."ID_ACCES"="ACT"."ID_ACCES")
    44 rows selected.

  • How to avoid multiple DataConnections with LCD ES2

    Hi, we are just starting using the data connections to connect via a database with LiveCycle Designer. It seems we are missing something important regarding to manipulation of data from the PDF.
    At first we have tried to apply a INSERT command to our first table and be able to browse through the items in the database. We are able to browse through the database only before we have inserted something.
    If we insert an item and then try to browse through the database with (Next, Previous, Last or First) it will crash and have an error of the following :
    (Next, Previous, Last or First) failed. Multiple-step operation generated errors. check each status value [ID:@11]
    So then we have decided to create a second data connection which would have each of the column in the database except for the ID which appears to make everything crash.
    E.G.:  Table_1
    DataConnection1 --> ID, Field1, Field2, Field3, Field4          SELECT Command connection
    DataConnection2 --> Field1, Field2, Field3, Field4               INSERT Command connection
    Seems like we can't have a SELECT and INSERT in the same DataConnection because with those 2 different connections it works fine....
    Then we are trying to show multiple data's in a table which is linked with the ID of the Selected ID in DataConnection1.. To show the data is all fine using a 3rd connection for that Table_2, then we are making sure a blank row is always there at the end of the table to be able to add this new entry to the database with a Add button to INSERT into the Table_2... Unfortunately we do not have a 2nd connection to that table because we cannot link those fields with the database for the purpose of a multiple entry view.
    We have tried to make a 2nd connection for the purpose of the INSERT but it doesnt work at all.
    We are basing ourselves on the sample provided by Stefan Cameron in his blog http://forms.stefcameron.com/2006/12/18/databases-inserting-updating-and-deleting-records/
    I am wondering if we are using the right functionalities and if it is the simplest way to work with databases...
    If anyone can help, it would be greatly appreciated!!
    Thanks in advance!
    Mag

    Don't forget to activate the RESOURCE_LIMIT parameter, which default is FALSE :
    alter system set RESOURCE_LIMIT = true;
    Laurent, I had a similar problem some time ago : I didn't want to avoid multiple access, but only control who was doing what. That's because moving from Client/Server to Web the TERMINAL column in V$SESSION becomes useless.
    I tried your solution, but I had to give up with it, because in my Forms9i application some forms call Reports, which generate a new session.
    I decided to use DBMS_APPLICATION_INFO, and this is satisfactory for my requirements, but I'm interested to discover other solutions.
    P.S. with my solution I'm able to limit accesses, because in the CLIENT_INFO string I put, among other things, the
    application user, so I can control if an user is already connected. The problem is that existing applications have to be modified .....:-(

  • Selection variable for next month in RFPERIOD_OPEN in closing cockpit

    Hi,
    we would like to use RFPERIOD_OPEN in the closing cockpit in order to open the next period on D-10 automatically. I would like to use the selection variables of the closing cockpit in the program variant in order to avoid unnecessary variant maintenance every month.
    Unfortunately I cannot find a variable for the next month. There is only SAP_FAST_CLOSE_PERIOD_P. Do you know if it is possible to base a calculation logic to derive the next period from SAP_FAST_CLOSE_PERIOD_P.
    Thanks!
    Kind regards,
    Mariya

    Thanks! I checked it, but the appearance of months and order is okay in T247.
    Any other ideas?
    I thought I read somewhere that this is a bug but can´t remember where I found that bug hint.

  • Populating select-options in a variant through selection variable

    I have a select-options on the selection screen of a report. I have created a variant for this report. Now i want to populate this variant field through selection variable (entries of table TVARVC). How can i manage to populate multiple values in this. Suppose i want the variant to hold a range of values, how do i set the variable in the table so that the multiple values can be set dynamically?

    Hi Ravi,
    I know how to populate select-options but i want to know how to set up the selection variable in table TVARVC for using it in populating a select-option in a report variant. we populate these selection variables using the transaction STVARV where we specify a value against a particular variable. How can this variable multiple values (for example a range) so that a select-option can be populated dynamically through this?
    regards,
    Priyank

  • Web Report - Selecting variable value

    Hi,
    I have web report, where one selection variable for company code is there.
    If i am running the report like compnay code 2000 it is working.
    The web report is having a facility to select multiple company code like >1000. Means before the text box to enter the company code 1000, there is another selection box where we can select =,>,< etc like that.
    If i am selecting > and company code 1000. Then report is not displaying any thing.
    But we have company codes > 1000 like 1001-1007,2000,3000.
    Could you please advise me what might be the wrong with this case.
    Thanks & Regards
    Srini

    One possibility would be that you are having a security issue. If you do not have authorization to see ALL companies > 1000, then your report will show no data (even if you do have authorization to see company 2000).
    Hope this helps...
    Bob

  • How to create selection variable on a Key Figure

    Dear Experts,
    I have a key figure 'No of Days' in the BEx Query. I need a selection variable which when the users provide the input, should give me the report output where the rows shows only those whose No of days are less or equal to the input value.
    I am able to create such a selection out of a Characteristics field but I am unable to create one from a key figure.
    Kindly note that we are not using the BW Portal. We are running this report in the webi from a Universe created from the BE Query.I know that it is possible to ceate such a scenario in Webi, but we want the selection coming from the BEx Query for better report performance.
    Thanks,
    Sai

    Hi Experts,
    Thanks for the suggestions. I cannot use the 'Condition' since this BEx query is being called from a Webi report. MDX will not recogonize the condition.
    I was able to create a Variable and use it in the calculated key figurare. The problem is , I am getting 1 where the condition is met and 0 when the condition is not met. But I want to see only the results where the condition is met. How to to avoid the rows where the result is not met.
    Am I getting this because there are actually 3 other key figures along in the query in addition to  the key figuare ' No of days'.
    Should I add some condition to the other key figuares also.
    Kindly confirm and help.
    Thanks,
    Sai

  • SQL Parser supporting nested queries

    Hi,
    I require a SQL parser that supprt nested queries. JavaCC doesnt support nested queries so that one is out. If anyone knows of any open sourse parser, please enlighten me. I have already looked enough on Google but not of much use.
    thanks,
    abulkd

    | 1. as suggested , i was able to get the oraclexmlsql.jar
    | from the servlet zip and loading it solved the problem of
    | the jdbc string being printed int he cursor syntax . it
    | works from the xmlgen utility withing pl/sql. but when
    | using OracleXML in a java prog the results still printout
    | the jdbc string.. any ideas...
    Could only be a CLASSPATH problem difference in your two
    tests.
    | 2. Is there anyway to supress the rownum attribute tag in
    | the subquery (cursor) results...that is the
    | setRowIdAttrName .... w/o using xslt
    Not at this time. Rownum supression on the subquery should
    probably follow your settings on the main query. I'll
    suggest to the devs.
    | 3. We are implementing a solution using these tools.... we
    | wanted to know which were the production versions.
    XDK Components for XML and XSLT are production.
    XML SQL Utility and XSQL Servlet are still Technical
    Previews and as such are not yet production.
    null

  • Can't select "Variable Speed" for Still Image Motion

    I am using FCP 5.1 to add motion to still images. I've placed my still images on the timeline and added the appropriate keyframes in the Motion tab of the Viewer to Scale, Rotate, and move the stills on screen to my liking. But the speed is locked to "Constant," and I want to change that.
    Specifically, am rolling a still image on-screen, freezing it in the middle of the screen a few seconds, and then rolling it off-screen. Doing this is easy: I just add a keyframe and type in the off-screen coordinates, then add another keyframe and type in coordinates somewhere on screen. But I want to vary the speed that the image rolls on-screen, so it moves on-screen quickly but then gradually slows down until it finally stops (freezes) in the middle of the screen.
    Unfortunately, the "Setting" popup menu under "Time Remap" in the Motion tab of the viewer is grayed out and locked to "Constant Speed" (and yes, my still image clip is indeed selected and being displayed in the view). I cannot figure out how to unlock that popup so I can select variable speed.
    I can choose Variable or Constant speed just fine for any imported "video" clips -- only still images are locked to Constant for some reason. Is this just a feature limitation of FCP 5? Any ideas would be appreciated.
    Many thanks.

    Why so much sarcasm in this FCP forum, Studio X?
    Yes, it was in the manual, which by the way is quite large. And I didn't say how long it took me to spot that in the manual either -- a long time. I didn't spot it the first time I had read through that section (yes, I had read it before). And the fact is, you didn't know it either, otherwise you may have cared to point it out (for not only myself, but for others reading this forum too).
    I participate in numerous other forums on other sites. Many times, people ask questions that are very simplistic to me -- I know the answers and I know those people putting forth the questions could easily have looked up the answer. Nevertheless, I take time to be helpful to others. For truly, some day I may be in their shoes, lacking time to read every part of every manual out there.
    I am therefore thankful to those who likewise respond in a tactful manner to my queries, with the productive aim of helping others rather than condemning them. Thank you, David Harbsmeier, for being consistently positive and very helpful in this forum!

  • Selection Variable Problem

    Hi All,
    We have the data in the backend as follows.
    Course            Prim instru  second instru      No. of Responses
    Java Course     Instruc1        Instruct2            12
    BW Course     Instruc3                                 10
    ABAP Course      Instruc2        Instruc3            15
    Portal Course      Instruc2                                 20
    we need to have a single selection variable for instructor and the result should be as follows.
    Variable Screen:
    Instructor = Instruc2
    Result:
    Course            Prim instru  No. of Responses
    Java Course     Instruc2       12
    ABAP Course      Instruc2       15
    Portal Course      Instruc2       20
    Any ideas on how to achieve this?
    Regards,
    rk.

    Hi there,
    It seems you're trying to achieve an "OR" in BEx queries, i.e., prime instructor OR second instructor as instructor2 (selected by the user as a variable input), is this right?
    If so, you can use another characteristic like for example named combined_instructor and fill it in the transactional data like this:
    Course            Prim instru  second instru         combined_instructor     No. of Responses
    Java Course     Instruc1        Instruct2              Instruc1_Instruct2         12
    BW Course     Instruc3                                   Instruc3                         10
    ABAP Course      Instruc2        Instruc3              Instruc2_Instruc3          15
    Portal Course      Instruc2                                   Instruc2                         20
    So, combined_instructor is the concetanation of the Prime and second instructor.
    So you can use a variable over combined_instructor, and if there is any
    *Instruct2*
    , you have all the options of Prime and second instructor with the Instruc2
    Diogo.

  • Changing selection variable of a workbook

    Hi Gurus
    I added a new query to a workbook of 7 queries.
    For all those 7 queries selection variable is profit centre
    But for the new query selection variable is profit centre and fiscal year period
    How can make a unique selection variable for the work book and where can i chan

    Hi,
    You need to provide the same variable(profit centre) for the new query also, then it will be applicable to all the queries. And use the Fiscal year variable for new query it will be applicable only for the new query.
    Hope this helps...
    Rgs,
    Ravikanth.

Maybe you are looking for