Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Do More with Qlik - for Beginners and Beyond, Topic: Qlik Replicate on January 21, 2PM EST. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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

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()

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.

Creator II
Creator II

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

Creator II
Creator II

Dear Ram,

Which one is better wrf to Performance?

Thanks,

Sarif