5 Replies Latest reply: Jan 7, 2013 3:05 AM by Effendi Gunawan

aggr function with rangesum(before()) not working

Dear all,

anyone can help me why this function doesn't return any value?

exp :

sum(

Aggr(

if(RangeSum(Before(if(sum(SALES_VALUE_GROSS)>0,1),0,3))=3,1)

,CUSTOMER_ID

)

)

thanks

• Re: aggr function with rangesum(before()) not working

Try this

Aggr(

sum(

if(RangeSum(Before(if(sum(SALES_VALUE_GROSS)>0,1),0,3))=3,1))

,CUSTOMER_ID

)

• Re: aggr function with rangesum(before()) not working

i'm sorry..it's still not working..i clarify in a moment..

thanks..

• Re: aggr function with rangesum(before()) not working

hey plz clarify what's  you actually want in output. i didn't get you exactly

• Re: aggr function with rangesum(before()) not working

hi

i think you miss this

sum( )CUSTOMER_ID

• Re: aggr function with rangesum(before()) not working

thanks to all for fast response..

here is my little problem..

i want to count CUSTOMER_ID which have transaction for the last 3 months..it said Loyal Customer..

if the customer_id doesn't have 3 transactions..it's not counted..

because count(if can not be used..so i try to manipulate using sum(aggr(rangesum(..which sometime working..but this case not..

1st exp :

if(sum(SALES_VALUE_GROSS)>0,1,0)

2nd exp :

RangeSum(Before(if(sum(SALES_VALUE_GROSS)>0,1),0,3))

3rd exp :

if(RangeSum(Before(if(sum(SALES_VALUE_GROSS)>0,1),0,3))=3,1)

4th exp :

sum(

Aggr(

if(RangeSum(Before(if(sum(SALES_VALUE_GROSS)>0,1),0,3))=3,1)

,CUSTOMER_ID

)

)

as everyone see..the 4th exp is just summary the 3rd exp..but unfortunately it is not working..

thanks