Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

TextCount vs. Count vs. Count (Distinct)

Attached is the table I'm working with.    Notice that AccountNumber A817998 shows up twice, and the net ChargeAmount = zero.

QV is doing something I don't understand.  Using various expressions to count the   number of items in he table, I get different results:

  • TextCount (Unit) = 14.  This is also correct, if account A817998 is ignored.
  • Count (Unit) = 14.  This is also correct, if account A817998 is ignored.
  • Count (Distinct AccountNumber) = 15.  There are indeed 15 accounts in the table, but this expression considers account A817998.
  • Count (ChargeAmount) = 16.  There are a total of 16 entries in the table, including both entries for account A817998.

What I don't understand is why TextCount (Unit) and Count (Unit) ignore account A817998.  That is exactly what I'm trying to do , but I don't understand why QV is ignoring that account.

Any ideas?

4 Replies
Not applicable

TextCount vs. Count vs. Count (Distinct)

You'll need to give some more details on how exactly you got 14 because I put the spreadsheet into QV and got 16,16,15, and 16 which is what it should be as far as I know.  I can't imagine how count(Unit) could get a different number than count(ChargeAmount)... are you doing this in the script or something?

erich_shiino
Honored Contributor

Re: TextCount vs. Count vs. Count (Distinct)

I tried to reproce your results, but I only got the expected results.

You can check my attachment.

Regards,

Erich

Highlighted
Not applicable

Re: TextCount vs. Count vs. Count (Distinct)

Thanks, guys.  Attached is a screen capture of my QV screen.

I'm not doing anything odd in the script.  Just loading 3 files (2 QVDs and 1 Excel).

I don't understand it either.  Maybe I don't understand how TextCount () works.  How is it different from Count()?.  The help file wasn't very helpful.

erich_shiino
Honored Contributor

Re: TextCount vs. Count vs. Count (Distinct)

You can include other 'counts' to better understand your result.

Try numericcount(), and nullcount()

count() will ignore nulls

nullcount() only for nulls

numericcount() will count only numbers (ignore text and nulls)

I guess textcount() ignores numbers

Hope this helps,

Erich

Community Browser