11 Replies Latest reply: Jul 9, 2014 7:45 AM by Avinash R

# Set Analysis - Basic BODMAS

Hi All

i wanted to divide X by Y first for Sales ID,Answer Z , so i want the aggregation of Z

E .g

 x y Z 10 5 2 20 4 5 Answer 7
• ###### Re: Set Analysis - Basic BODMAS

Hi Jayanth,

Please use AGGR(x/y,Z) .... in the expression total select sum .

Hope this is what ur looking for.

• ###### Re: Set Analysis - Basic BODMAS

Hi

could you please verify the below expression  is correct

=Aggr((sum(if([SHIPPED QTY]>0 and [QTY VARIANCE]<0,[QTY VARIANCE],'0')))*-1)*(sum([FULL FOB])/sum(PACK))

• ###### Re: Set Analysis - Basic BODMAS

where

FULL FOB = X

PACK    = Y

• ###### Re: Set Analysis - Basic BODMAS

Try like this

Aggr(if([SHIPPED QTY]>0 and [QTY VARIANCE]<0,sum([QTY VARIANCE],0)*(sum([FULL FOB])/sum(PACK)),Z)

Where Z is the field on which you need to do the aggregation.

• ###### Re: Set Analysis - Basic BODMAS

hi both

thank you for the support

But i have little messed up with this . i wanted to divide Full Pack (X) by Pack(Y) and then add them .

E.g

X =10,20

Y = 5,10

so what i want  is(10/5) +(20/10)= 4

whereas my script reads them as (10+20) /(5+10)=2 which is incorrect

Sorry for the inconvenience caused

• ###### Re: Set Analysis - Basic BODMAS

Try like this

sum([Full Pack]/[Pack])...this will give u the result

• ###### Re: Set Analysis - Basic BODMAS

wow, sorted

thank you all

Cheers

• ###### Re: Set Analysis - Basic BODMAS

Hi Jayanthan,

Regards,

@vi

• ###### Re: Set Analysis - Basic BODMAS

Hi,

You need to add dimension in aggregation and finally enclose with sum function.

=Sum(Aggr((sum(if([SHIPPED QTY]>0 and [QTY VARIANCE]<0,[QTY VARIANCE],'0')))*-1)*(sum([FULL FOB])/sum(PACK), Dimension))

• ###### Re: Set Analysis - Basic BODMAS

you missed dimension in aggr() function

=Aggr((sum(if([SHIPPED QTY]>0 and [QTY VARIANCE]<0,[QTY VARIANCE],'0')))*-1,DIMENSION)*(sum([FULL FOB])/sum(PACK))