cancel
Showing results for 
Search instead for 
Did you mean: 

BEx query design: defining complex filters?

Former Member
0 Kudos

Is it possible to define complex filters in a query definition? By complex I mean using logical operators (AND, OR, NOT)

Example: report giving sales results

I want to have

(Customers from Germany <b> AND </b> product type A)

<b> OR </b>

(Customers from Romania <b> AND </b> product type B)

If I define a standard filter:

Customer country IN (DE,RO)

Product type IN (A,B)

I will obtain all combinations while I only want to have the couples {(DE,A),(RO,B)}.

Thxs.

LauQ

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Laurent

I have posted a new topic called complex filters. Please reply to that so that I can award you points

Thanks

Raj

Former Member
0 Kudos

If you in front that you have requirements of this kind you could also define additional InfoObjects only for this case, e.g. CUSPROD where you concatenate customer country and product type. Once I had a very complex selection where I created an InfoObject that was filled via UserExit with a value 1 to 4 on which the customer could filter. The logic was depending on four different InfoObjects and two lookup tables in the system and would have been nearly impossible to build in a query.

Best regards

Dirk

Former Member
0 Kudos

Hi Dirk,

In my opinion, this pinpoints a drawback of BEx if one compares it with other third-party reporting tools such as Business Objects, where such complex filters can be created ad-hoc in a few seconds...

Regards.

LauQ

Former Member
0 Kudos

> Hi Dirk,

>

> In my opinion, this pinpoints a drawback of BEx if

> one compares it with other third-party reporting

> tools such as Business Objects, where such complex

> filters can be created ad-hoc in a few seconds...

>

> Regards.

>

> LauQ

Complex filtering is definitely a weak point in BEx. But last time I've been in Walldorf there were still developers working on BW. Maybe they will find the time one day.

Best regards

Dirk

mstrein
Active Participant
0 Kudos

Hi Laurent,

if you need the combination in one query, try the work around.

1) Define the filters as structure in columns or rows

2) Hide the filter selections

3) Sum them up in a formula

Hope that helped,

Michael

Former Member
0 Kudos

Hi Michael,

I'm trying and give you feedback...

LauQ

Former Member
0 Kudos

OK Michael,

I obtained a result by making use of the Help cells and the procedure you mentioned.

However, this becomes quite intricate when you need more complex filters (several combinations of characteristics).

Thxs.

LauQ

Former Member
0 Kudos

Hi Micheal

In your mail you have said define a structure for the filters and hide the filter selections?

How can you hide them? can you please tell me the way to hide it.

Thanks

Raj

Former Member
0 Kudos

Hi,

(Michael, let me answer if you don't mind...)

You just have to right-click and go to properties, then select "hide" or "always hide" in the right-handside of the display area.

Regards.

LauQ

Former Member
0 Kudos

Hello Laurent,

You said right click and select hide. do we do this at query designer? and even if we hide it is the hide function same as Filter? selecting hide will filter the whole output of the query ?

I thought hide will only hide that particular column or row in the result area.

please help me

Thanks

Raj

Former Member
0 Kudos

Hide is just to remove the "object" from the display. It is used as an intermediate filter for the object that includes the logical combinations that one would like to get in the results.

In my example:

In the Query Designer:

1. Define a structure (rows)

2. right-click on it and make new selections corresponding with

a) Country=Germany (:='DE')

b) Country=Romania (:='RO')

c) Material=A

d) Material=B

3. Right-click on each of them and "hide" them

4. New formula in the structure:

TEST:=(( 'DE' AND 'A' ) OR ( 'RO' AND 'B' ) )

5. You need to edit the Cell definition and make use of the Help Cells (select therein the KF you need to display; e.g. "QUANTITY SOLD").

6. "Play" with Cell definition and define a final KF such as:

FINAL:='QUANTITY SOLD' * 'HELP'

You need to try by yourself...

Regards

LauQ

Former Member
0 Kudos

Hello Laurent,

Thanks for your reply. It helped a lot. From what I gather from your mail, I beleive that you are trying to restrict one key figure with the combination of the char's.

" You need to edit the Cell definition and make use of the Help Cells (select therein the KF you need to display; e.g. "QUANTITY SOLD")."

Can you provide me with some links that have information on cells as I have never really worked on them.

Thanks

Raj

Former Member
0 Kudos

Raj,

I open a separate message so that you can grant me some points if you wish...

Former Member
Former Member
0 Kudos

Hello Laurent

Please open up another topic so that I can award you points. you were really helpful

Thanks

Raj

mstrein
Active Participant
0 Kudos

Hi Raj,

why don't you open a new thread for your questions and give Laurant the chance to earn some points for his efforts?

http://help.sap.com/saphelp_bw30b/helpdata/en/f1/0a5a2ee09411d2acb90000e829fbfe/frameset.htm

regards,

Michael

mstrein
Active Participant
0 Kudos

Hi Raj,

you need to open the thread and post a question. Laurent can then give you an answer and you assign him points.

thats better than "kidnapping" a thread.

regards,

Michael

Former Member
0 Kudos

Hello laurent,

I am trying to work out the process you have mentioned . I used the following steps

1. created a structure for keyfig

2. created a struct for char added the selections and hide them.

3. I have created the appropriate formula for the structure.

4. In the cell definition, i created a help cell for the key fig using selection.

5. Now my question is how can I restrict the keyfig in main cell using the help cell and the formula.

please help me.

sorry for asking you such basic stuff.

Thanks

Raj