4 Replies Latest reply: Jul 7, 2011 10:50 PM by Shi Hui Zhang

# Set Analysis & Current Field Selection

Hi all,

I need some help in formulating a set analysis for my table. Currently I have a region list box consisting of ( America, Asia, Oceania, etc etc) and a country list box (Australia, South africa etc)

I would like my end result to be like this ---> Sum of Order for the current selection in region list box divided by Sum of orders for the current selection in country list box.

Example:

Total Orders counts in Oceania = 1000

Total Order Counts in Australia = 10

Result = 100

• ###### Set Analysis & Current Field Selection

Hi,

Set analyses would do it/
Expr1: Sum({<(Counrty = )>} Orders)

Expr2 : Sum({<(Region= )>} Orders)

Expr3: Expr1/Expr2

Regards,

Jonathan

• ###### Re: Set Analysis & Current Field Selection

Thanks jonathan!

I have some changes in the expression ( bracket before the word "country" removed)  and combined the them into one:

Sum({Region=>} Order) / Sum(Country=>} Order)

It works fine ! Thanks again

• ###### Re: Set Analysis & Current Field Selection

Hi,

I agree with Jonathan about that set analysis will do, although the expressions should be different (assuming you are always going to select a country within a continent):

```Sum({< Country = >} TOTAL OrderAmount) / Sum(OrderAmount)
```

The dividend is used to keep the continent selection, regardless the country selected. The divisor will return the sum for the current selection: if there is no contry or continent selected, the result shuold be 1 (sum of all divided by sum of all).

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica