Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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
MVP
MVP

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