1 Reply Latest reply: Mar 27, 2013 3:05 PM by Gysbert Wassenaar

# Set analysis why need aggr function

Hi guys,

I'm having the following problem:

I created a setanalysis, which sum all data on the conditions shown below. With the  records found I pretend calculate [Quantity] *[ValorMoeda] *[Unit Value].

However when I put the expression "set analysis" without the aggregation condition the sum of the lines was incorrect. After some research, I came to the following expression, but I had serious doubts:

Why I have to do an aggregation inside a Set Analysis?

Form me it is the first time that the sum does not equal the lines!

Despite apparently having reached a solution, I need understand the impacts. If anyone can help..

Bruno

=sum({\$<MonthID = ,
Year = ,
Quarter = ,
Period = ,
[Period (#)] = ,
Month = ,
[Recurso Humano  ]={"=Len([Recurso Humano  ]) = 0"},
[Número de Encomenda NAV  ]={"=Len([Número de Encomenda NAV  ]) = 0"},
[Aprovação de Requisição  ]={"Approved"},
[Reembolso  ]={"Não"},
Quant_Pend={">0"},
>}
aggr(
sum({<MonthID = ,
Year = ,
Quarter = ,
Period = ,
[Period (#)] = ,
Month = ,
[Recurso Humano  ]={"=Len([Recurso Humano  ]) = 0"},
[Número de Encomenda NAV  ]={"=Len([Número de Encomenda NAV  ]) = 0"},
[Aprovação de Requisição  ]={"Approved"},
[Reembolso  ]={"Não"},
Quant_Pend={">0"},