6 Replies Latest reply: Oct 26, 2012 9:53 AM by steve peroni

# set analisys

Dear all,

I have this calculated dimension:

aggr(sum(PURCHASEVALUE), SUPPLIER, PURCHASE_month)

and it works, but I would sum PurchaseValue just till September

Is it possible to insert a condition, like PURCHASE_month <= 9 ?

How can I solve this problem ?

• ###### Re: set analisys

Hi

use this expression

aggr(sum({<PURCHASE_month={' <= 9'}>}PURCHASEVALUE), SUPPLIER, PURCHASE_month)

• ###### Re: set analisys

Hi Perumal,

it works, I just changed  the '  with the "

One thing more: instead of 9 as month, may I insert a field name ? I tried it but it doesn't work.

like:

aggr(sum ........month={" <= MY_FIELD "} ..........)

Thanks

• ###### Re: set analisys

Hi,

I have one doubt ,MY_FIELD filed contains only one data or multiple data

Try this expression

aggr(sum({<PURCHASE_month={' <= \$(=max(MY_FIELD))'}>}PURCHASEVALUE), SUPPLIER, PURCHASE_month)

• ###### Re: set analisys

Hi,

It doesn't work. But perhaps it's better I give you something more.

My user has the possibility to choose Year and Month. I've to calculate for each supplier

the total purchases amount based on the year and month. If I choose August, I have to calculate the sum of all the values till August; the same if I choose June or another month.

By aggr function I always calculated the total and It's wrong.

Aggr, I think is the right way, but I don't know how to insert the condition by a field

• ###### Re: set analisys

Hi,

It is possible upload sample application for reference

• ###### Re: set analisys

Hi Perumal,

TRy this:

=aggr(sum({<PURCHASE_MONTH={ "<= \$(=only(MY_MONTH))"}>} PURCHASEVALUE),SUPPLIER, PURCHASE_MONTH).

I'm going to do other checks now, just to be sure, but it seems correct ( I strongly hope)

I'll keep you informed