13 Replies Latest reply: Dec 26, 2013 2:43 PM by Kevin Pinto

# or in set analysis

Good day everyone,

The set analysis example below returns the sales for current selection, with new selections both in "Year" AND in "Region",

=sum({\$<Year = {2000}, Region = {US, SE, DE, UK, FR}> Sales)

My question is how about for the OR, is there a way for this?

Thanks in advance and more pwoer...

Jason

• ###### or in set analysis

You can find more examples on page 353 of manual

=sum({\$<Year = {2000},Region += {US, SE, DE, UK, FR}>} Sales)

• ###### or in set analysis

Hi Irossi,

Thanks for the reply. Basically the set analysis returns the sales with selections both in "Year" AND "Region. What about for "Year" OR "Region"? Is it correct to have:

=sum({\$<Year = {2000} OR Region = {US, SE, DE, UK, FR}>} Sales)

?

Thanks again,

jason

• ###### or in set analysis

Hello,

Maybe what you are trying to accomplish is not really something that you would use Set Analysis for.

Think about it... the variables being set using set analysis are not conditions, what you do with set analysis is narrow your universe of information to something very specific, sometimes regardless your selections. If there was a way of using an OR operator in set analysis, you would have two sets of data... how do you define which one to use in your expression?

What I'm guessing is that you want the expression to be evaluated either when the year selected is 2000 or when selecting some of the specified Regions. If my guess is correct, you can use the function getfieldselections.

Hope this helps.

Mike.

• ###### or in set analysis

An "OR" in set analysis is a union of two sets. You do a union with the "+" operator like so:

sum({<Year={2000}>+<Region={US,SE,DE,UK,FR}> Sales)

• ###### or in set analysis

ok, thank you very much.

jason

• ###### or in set analysis

Please explain with an example, that will help me to implement the concept in my application.

• ###### or in set analysis

Hi John,

could you please verify the sample above, it seems to be a broken feature. It's not working for me in V9R3 and V9R5.

regards

Sven

• ###### or in set analysis

ps.:

I've just recognised, it's working again in V9R6.

be aware & happy qliking

Sven

• ###### or in set analysis

Strange, your file is working for me in V9R5. Ah, well. At least it's working for you again in V9SR6.

• ###### Re: or in set analysis

Great! But how would you write a SET with OR and AND conditions?

Like sum({<Year={2000}>+<Region={US,SE,DE,UK,FR}> AND Product={Shoes}> Sales)

• ###### Re: or in set analysis

Thanks, this helped me solve a similar problem!

• ###### or in set analysis

Hi there, why dont you try splitting the expression in two, like this:

=sum({ \$<Year = {2000}> } Sales) + sum({ \$<Region = {US, SE, DE, UK, FR}> } Sales)

Regards

• ###### or in set analysis

Hai,

how can i place in group instead of single filed in the expression

Thanks