Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
john_duffy
Partner - Creator III
Partner - Creator III

Issue using the Count function on a concatenated field.

We have recently upgraded from QV 7.5 to QV 9.

I have a chart that uses the Count function on a concatenated field in an expression. (eg. Count (field1&field2)). Field1 is numeric and field 2 is char. In QV9, the expression returns zero. In QV7.5, the same expression returns the correct value. If I concatenate the fields in the load script, the expression returns the correct value.

If I concatenate two numeric fields in an expression, the Count function returns the correct value.

If I concatenate two character fields in an expression, the Count function returns zero.

I also seem to be getting incorrect values when using NumCount if a concatenated field is used in an expression.

I have attached a sample application to illustrate the issue.

Is there an issue using the Count and Numcount functions with QV9?

3 Replies
fernandotoledo
Partner - Specialist
Partner - Specialist

aCTUALY since version 8.5 there are some restrictions in the sintax of aggregation function. In this case if you use count(distinct A & B) it works

johnw
Champion III
Champion III

Looks like a bug to me.

Edit: So it's a "feature"? Like when they stopped automatically applying "distinct" to count() when counting key fields, the argument, I assume, being that since a key field links multiple tables, count(keyfield) is really undefined? So now we need to say it explicitly? Same here, because it's arguably unclear what we mean by count(A&B), so now we have to explicitly say "distinct" instead of QlikView having a default interpretation? Well good, then, because obviously returning 0 is better than making an assumption, and I'd sure hate to be able to use a simpler syntax when I could use a more complicated one, and I certainly wouldn't want my charts to just keep working when I upgrade. Go QlikTech. *sigh* Sometimes I really wonder what they're thinking. Great product overall. Too bad about the constant churn of bugs and undesirable "features" and us needing to fix half our applications every time we upgrade to a new version. Hmm (Edit: Grumpy because I just finished a week and a half of fixing applications to move from 8.5 to 9.0 SR4, and because I missed one of our count(keyfield) expressions, and as a result bad data recently ended up in a report in front of one of our vice presidents.)

john_duffy
Partner - Creator III
Partner - Creator III
Author

Thanks for the information.

Unfortunately, I cannot use Distinct in my production application as I am counting the number of occurances of the same value over a period of time. I do have a couple of work arounds - Concatenate the field in the load scripts or sum the TextCount and the NumericCount of the concatenated field in the expression.