4 Replies Latest reply: Aug 26, 2016 7:43 AM by Mohammad Sarif

Diff between Sum(1) and Count(1)

Hello All,

Can you please make me understand what is difference between Sum(1) and Count(1). I checked with my test data set. It looks same to me. Is there any Performance difference between them?

Thanks,

Sarif

• Re: Diff between Sum(1) and Count(1)

AFAIK there shouldn't be any difference in performance. Check this link:

HIC did a comparison between Count(), Count(DISTINCT ...), and Sum()

• Re: Diff between Sum(1) and Count(1)

Hi Sarif,

---> Sum(1) : If you have Dimension like A,B,C and user expression is sum(1) means this will return value is A=3,B=3,C=3. It sums the number of dimensions. if you use sum(2) as expression it will returns A=6,B=6,C=6. which means it sums the dimensions two times.

---> Count(1): If you have Dimension like A,B,C and user expression is Count(1) means this will returns A=3,B=3,C=3. It Counts the number of dimensions.if you use Count(2) as expression it will returns A=3,B=3,C=3. which means it Counts the dimensions only one time.

• Re: Diff between Sum(1) and Count(1)

There is no difference between Sum(1) and Count(1) on performance wise(tested on 10M data sets).

• Re: Diff between Sum(1) and Count(1)

Dear Ram,

Which one is better wrf to Performance?

Thanks,

Sarif