5 Replies Latest reply: Nov 2, 2012 11:46 AM by steve peroni

# set analisys troubles

Hi,

I don't know why the following expression doesn't work properly:

=aggr(sum({<MYMONTH={ "<= \$(=only(PURCHASE_MONTH))"}, MY_YEAR ={"=\$(CURRENTYEAR)-1)"}>} Purchase_amount), Supplier_code)

What I would have is the sum of purchase amount till the selected month (MY_MONTH), but for the previuos year (2011).

It doesn't recognize the ..{"= \$(currenyear)-1)....  expression. The result is nothing.

The following expression works properly

=aggr(sum({<MYMONTH={ "<= \$(=only(PURCHASE_MONTH))"}, MY_YEAR ={"= \$(CURRENTYEAR)"}>} Purchase_amount),Supplier_code)

I really don't understand. Help please

• ###### Re: set analisys troubles

Hi

Try like this

=aggr(sum({<MYMONTH={ "<= \$(=only(PURCHASE_MONTH))"}, MY_YEAR ={"=\$(AddYears(CURRENTYEAR - 1)"}>} Purchase_amount), Supplier_code)

Regards

Iyyappan

• ###### Re: set analisys troubles

Hi Iyyappan V,

it doesn't work. I get the message Error dimensions

Thanks anyway

• ###### Re: set analisys troubles

You have DateField?If so better go with that.

Example:

))"},MYMONTH=,MY_YEAR>} Purchase_amount), Supplier_code)

or based on your Expression it will be

=aggr(sum({<MYMONTH={ "<= \$(=only(PURCHASE_MONTH))"}, MY_YEAR ={\$(=\$(CURRENTYEAR)-1))}>} Purchase_amount), Supplier_code)

• ###### Re: set analisys troubles

Thanks very much  Celambarasan

and thanks to anyone has spent his time to help me.

stefan

• ###### Re: set analisys troubles

Hi

I think this shoud work:

=Aggr(sum({<MYMONTH={"<=\$(=Only(PURCHASE_MONTH))"}, MY_YEAR ={"=\$(=CURRENTYEAR-1)"}>} Purchase_amount), Supplier_code)

Hope that helps

Jonathan