cancel
Showing results for 
Search instead for 
Did you mean: 

Replacement path using Query - How to filter based on values entered in main query?

Loed
Active Contributor
0 Kudos

Hi guys,

Just want to ask if there is a way to filter the query used in the replacement path (query) based on the values entered in the main query?

For example:

QUERY1 (main query) - FILTER TAB (doesn't have the SEGMENT field) - under DSO1

ZVAR_MONTH - variable for 0CALMONTH with MANUAL INPUT (interval)

ZVAR_COMPCODE - variable for 0COMPCODE with replacement path (using the QUERY2)

QUERY2 (sub query) - FILTER TAB - under DSO2

SEGMENT - filter to include "TEST" values only

ROWS/COLUMNS TAB

0COMP_CODE (jn ROWS)

With the queries above, my result in QUERY1 will be all the company codes under the SEGMENT "TEST". Right?

However, I have several data in my DSO2 so the query reads all the data just to get the values of company codes under segment "TEST". Thus, the QUERY1 runs SO SLOW, more than 30 mins just for a month data. Without the ZVAR_COMPCODE, the query runs under 5 minutes for 1 month of data.

I'm just wondering if there is a way to filter the QUERY2 using the values entered in QUERY1 for ZVAR_MONTH? So, if user entered 10/2016 in QUERY1, I wanted QUERY2 to read only the data under 10/2016 also and not the whole data of DSO2.

Is this possible?

Thank you.

Loed Despuig

Loed
Active Contributor
0 Kudos

Any idea guys?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member199945
Active Contributor
0 Kudos
Loed
Active Contributor
0 Kudos

Hi Seshu,

I already applied same concept with the link you have posted. I already have the QUERY1 and QUERY2.

Right now, I was wondering if there is a way to filter my QUERY2 using the values entered in QUERY1.

So, if user entered 10/2016 in QUERY1, I wanted QUERY2 to read only the data under 10/2016 also and not the whole data of DSO2 since it will affect the query performance of QUERY2.

Hope you get my explanation.

Thank you.

Loed

former_member188743
Active Participant
0 Kudos

Hi Loed,

Take a look at the following for helping out here:

1385580 - How does a formula variable with a replacement path work?

https://wiki.scn.sap.com/wiki/display/BI/OT-OLAP+Formula+Variables

Thanks,
Diego Seben.

Loed
Active Contributor
0 Kudos

Hi,

I think you did not understand my question?

I was wondering if there is a way to filter my QUERY2 using the values entered in QUERY1.

Anyway thanks for your reply. 😉

Any other idea guys?

Loed