6 Replies Latest reply: Aug 3, 2017 8:33 AM by kushal chawda

# changing the expression

Hello All,

is it possible to write below expression in different way without using Total function

Sum({<[YEAR]={\$(=max([YEAR])-1)}>}total<Part,[PLANT NAME],FISCYEAR>Value)

i tried this but i am getting null values

aggr(nodistinct  Sum({<[YEAR]={\$(=max([YEAR])-1)}>}Value),Part,[PLANT NAME],FISCYEAR)

can suggestion .....

thanks

• ###### Re: changing the expression

Why nodistinct  in the second expression ??

• ###### Re: changing the expression

i tried without using nodistinct but still i am getting all values as null

aggr(Sum({<[YEAR]={\$(=max([YEAR])-1)}>}Value),Part,[PLANT NAME],FISCYEAR)

• ###### Re: changing the expression

May be this

Only({<[YEAR]={\$(=max([YEAR])-1)}>} Aggr(NODISTINCT Sum({<[YEAR]={\$(=max([YEAR])-1)}>}Value), Part, [PLANT NAME], FISCYEAR))

• ###### Re: changing the expression

Thanks for your reply,my server gone down i am enable to check ur expression in the mean could u please suggest me the below expression is it a vaild expression

in a straight table

colume(1) is sum of quantity

colume (2) is sum of value

colume(3) is colume(1)*colume(2)

now in  columne(4) can i write expression in this way

aggr(colume(3),part,[PLANT NAME],FISCYEAR)

Is this a valid one.....

• ###### Re: changing the expression

You cannot use Column() function with Aggr(), use the underlying expressions instead of column reference

• ###### Re: changing the expression

=sum({<[YEAR]={\$(=max([YEAR])-1)}>}aggr(Sum({<[YEAR]={\$(=max([YEAR])-1)}>}Value),Part,[PLANT NAME],FISCYEAR))