Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

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 in advance for your help...

Thanks,

Sarif

4 Replies
sunny_talwar

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

A Myth About Count(distinct …)

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

jayaseelan
Creator III
Creator III

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.

ramkrishna86
Creator II
Creator II

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

mhmmd_srf
Creator II
Creator II
Author

Dear Ram,

Which one is better wrf to Performance?

Thanks,

Sarif