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: 
dawgfather
Creator
Creator

Distinct count expression not giving "distinct" results

Normally my expressions of "Count(Distinct FieldName)" come out correctly, but I am running into a chart where I have a discrepancy.

My "Distinct" count shows me a count of 10,149 FieldName's but if I turn it from a bar chart into a general chart and export to Excel, then take that FieldName column's data and "Remove Duplicates" (which is what the "Distinct" function should do right?) I get 849 results remaining.

So why would the Count(Distinct FieldName) not be returning that 849 value if there are proven to be only 849 distinct FieldName values?

I have gone back in several times with several reloads, all with the same results.

1 Solution

Accepted Solutions
dawgfather
Creator
Creator
Author

I think I found the answer - I had 2 charts - 1 as a bar and 1 as a general. The general chart had another field in there and I found that the field was null for some entries, so the general chart did not have all the line items for me to compare.

The bar chart with only the 1 dimension and 1 expression was correct after all. My general chart was missing information since QV ignored the nulls.

Thanks for the pointers.

View solution in original post

4 Replies
sunny_talwar

Do you have a dimension in this chart? Distinct usually gives a distinct count per dimension. So, if something repeats in two dimensions, it will be counted 1 for both the dimension value. For example

Country, City

India, Dehi

USA, Delhi

Although the distinct count of City is 1, but it will be counted 1 for India and 1 for USA... making it 2

Anonymous
Not applicable

Agree with Sunny. There might be another dimensions associated with 'FieldName' column which is making it duplicate.

dawgfather
Creator
Creator
Author

I think I found the answer - I had 2 charts - 1 as a bar and 1 as a general. The general chart had another field in there and I found that the field was null for some entries, so the general chart did not have all the line items for me to compare.

The bar chart with only the 1 dimension and 1 expression was correct after all. My general chart was missing information since QV ignored the nulls.

Thanks for the pointers.

aryaneski
Contributor
Contributor

Hi Sunny,
I'm new to Qlik and I have this issue. What's the suggested process so that Dlehi will only be counted as 1?