16 Replies Latest reply: Apr 17, 2014 7:55 AM by Manish Kachhia

# aggr function

Hi.I faced a problem.

I have tw fields Subregion and Product. Expr  is

cout({\$<CalendarYearQuarter={'2013-Q1'}>} distinct CustINN )

In total we see 3362. How to write expression which will calculate this total sum in front of every product.

What I would like to get is

This   expression   aggr( sum(Expr),Subregion  )   doesn`t work.

• ###### Re: aggr function

Try this

aggr(Nodistinct sum(Expr),Subregion, Product  )

or

Sum( aggr( sum(Expr),Subregion  ))

• ###### Re: aggr function

doesn`t help

• ###### Re: aggr function

try using sum({1}Field)

• ###### Re: aggr function

This expression  aggr(count(DISTINCT CustINN),Subregion)    works

but  it show result next to only one product((

Is it possible to correct it?

• ###### Re: aggr function

aggr(count({1}DISTINCT CustINN),Subregion)

• ###### Re: aggr function

Full Total

SUM(TOTAL Expr)

For SubRegion wise Total

SUM(TOTAL <SubRegion> Expr)

• ###### Re: aggr function

It doesn`t work too. It shows 0 or -(NULL)

• ###### Re: aggr function

What is expr...

means what is the expression behind expr?

• ###### Re: aggr function

cout({\$<CalendarYearQuarter={'2013-Q1'}>} distinct CustINN )

• ###### Re: aggr function

cout({\$<CalendarYearQuarter={'2013-Q1'}>} distinct CustINN )

• ###### Re: aggr function

Full Total

count(TOTAL {<CalendarYearQuarter={'2013-Q1'}>} Distinct CustINN )

For SubRegion wise Total

count(TOTAL <Subregion>{<CalendarYearQuarter={'2013-Q1'}>} Distinct CustINN )

• ###### Re: aggr function

Manish, you are geneus) It Works!  Thank you very much)

• ###### Re: aggr function

Manish, one more question. I didn`t notice that the filter was on Subregion. So this expression

count(TOTAL <Subregion>{<CalendarYearQuarter={'2013-Q1'}>} Distinct CustINN )

calculate total amount, but how to aggregate it by Subregion? Thanks

• ###### Re: aggr function

Full Total

count(TOTAL {<CalendarYearQuarter={'2013-Q1'}>} Distinct CustINN )

For SubRegion wise Total

count(TOTAL <Subregion>{<CalendarYearQuarter={'2013-Q1'}>} Distinct CustINN )