Quick Tips #5 - Expressions, count(distinct <fieldname>)

When following the Quick Tips #5 you should always check for any occurrence of Count(Distinct <fieldname>) by searching for the word "distinct" in the Expression Overview. Try to avoid this function because it forces QlikView to switch from using many cores to use only one core. You can verify this by checking the utilization of the different cores in Task Manager as suggested in Quick Tips #1.


Normally the purpose of the count-distinct is to count the number of unique dimensional values like - how many customers has bought a product?


A technique to solve this in a multi-threaded way is to create a constant value of 1 in the dimension table and then use a sum() of that field instead.


Cheers from the Scalability Team.