cancel
Showing results for 
Search instead for 
Did you mean: 

BEx query with conditions is not working as replacement path

Former Member
0 Kudos


Hello Gurus,

I am trying to use one BEx query which is having Transaction Number and Date difference (Created date and System date) as a replacement path in another query. Replacement path will be of Transaction number.

My requirement is to display only those records in a seperate query which satisfy the condition = 30 > (System date - Created Date) > 19.

To test whether replacement path is working fine, I tested it by restricting the first query globally with three transaction numbers and Execute the 2nd query. In this case my 2nd query is only executed for those transaction numbers.

That is replacement path is working.

But when I am applying the condition on key figure (Date subtraction) in my first query it did not work.

2nd query restriction is not working and displaying all the records.

I have tried below scenarios anf non of them worked.

1. Tried using formula

2. tried using calculated key figure

3. tried zero suppression (got warning variable replacement not possible)

I found below post which is for similar problem, but did not work for me. Could you guys please help ?

I am using BW 7.3

Regards,

Sonjoy das

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Lin,

I observed that if I use condition on existing key figure, restriction is working on second query.

Only if I use condition on formula output restriction is not working.

@Kumar Yes. The condition works fine in case of first query, However, I have to use Characteristic assignment either in row level or I have to give the characteristic combination.

Regards,

Sonjoy Das

giselle_lin
Active Participant
0 Kudos

The condition on formula shall also work in prequery. The example in http://wiki.scn.sap.com/wiki/x/mgGlFw uses condition on a formula. Please check the other details. You need to make sure when the first query with only Transaction Number drilled down,  the condition works.

Former Member
0 Kudos

Thanks for your response Lin.  Actuall in my prequery I used two characteristic one is created date another is transaction number. The created date I am using in formula. So I will not be able to drill down only with transaction number.

I believe you are right, may be that is the reason the repquery condition is not considered.

Regards,

Sonjoy Das

giselle_lin
Active Participant
0 Kudos

The important rule of prequery is: in the main query, the prequery is only exeuted with the relavent characteristic drilled down. Therefore the condition has to defined to work when only the replaced characteristic is drilled down.

If you need created date in your formula, you could use it in query in free characteristic, then use exception aggregation defined on created date on the formula. In this way you will get implicit drill down of created date in the formula.


Former Member
0 Kudos

As I am currently facing same issue with pre-query + condition my question is:

If my pre-query has a condition that uses more than two characteristics in drill down I cannot use it as I cannot get the condition working with only the characteristic used in main query, right?

Because my calculated key figure is evaluated in the condition at plant, profit center, company code, sales order level   and if I place all but sales order number (which I want in the main query) in free chars the condition is no longer working.

So I am stuck... or any ideas?

Axel

giselle_lin
Active Participant
0 Kudos

No, condition defined on more than two characteristics will not work in prequery.

Former Member
0 Kudos

Hi Sanjoy,

Do you have any global restrictions on date for second query. Global date variable will overwrite all the remaining variableas and display all the results - verify.

Did you try the calculation in the first query by executing it alone. Its better to verify self behaviour and then use in other query.

- Kumar

giselle_lin
Active Participant
0 Kudos

Hello Sonjoy,

The behavior is explained in http://wiki.scn.sap.com/wiki/x/F5mPFw

and http://wiki.scn.sap.com/wiki/x/mgGlFw

Sometimes the condition doesn't work in prequery, you need to adjust the prequery to make it work when only transaction number is drilled down.