cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Selection Criteria to another Query

Former Member
0 Kudos

Hello,

Is there a way to link two queries that have the exact same variables such that a refresh of Query1 will automatically pass same selection criteria to Query2 and execute without prompting users with a second selection box?

For example, since our two queries have identical variables, when the workbook is first launched the users are only prompted for selection criteria once. Both queries are then executed for same selection.

However, when Query1 is later refreshed with new selection criteria, Query2 is not refreshed automatically.

I have read some of the "SAPBExSetFilterValue" threads but am not sure if these apply since I want to pass all variable selection crieteria and not a filter value. Also, we have a hierarchy node variable which does not show as a "Filter" text element.

Thanks,

Adam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Adam,

If you have 2 (or more) queries in the same workbook and you refresh using:

Run "SAPBEX.XLA!SAPBEXrefresh", True

then, all queries will be refreshed. If the two (or more) queries have identical variable selection, then the user will see only one variable selection screen. If the two queries (or more) have slightly different selection screens, then the user will only the selections that were not included in the first screen.

You didn't ask, but just to be complete in the response ...

Let's say you have 3 queries in the workbook; Q1 has 6 selection criteria, Q2 has 4 criteria of the 6, and Q3 has 2 criteria of the 6. If the queries were embedded in the workbook in order Q1, Q2, Q3 then the user will see a screen with 2 selection criteria as each query refreshes. (2, then 2 more, then 2 more).

However, if the queries were embedded in the workbook in reverse order ... Q3, Q2, Q1, then the user will see 6 selection criteria in the first screen and no screen will appear when Q2 and Q3 refresh.

In other words ... BEx will refresh queries in reverse order of when they were embedded in the workbook.

- Pete

Former Member
0 Kudos

Peter,

Thanks for the reply. It was extremely helpful. I wasn't sure if Bex could intelligently prompt for only the unique variables across multiple queries but your reply has confirmed this IS the case.

Best,

Adam

Answers (0)