Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count TOTAL # of Lines including Nulls

Hey so I have an excel file that has 802 lines of data with two columns, one being product and the other being model. In this data, some of the products or model repeats, so if I count distinct product and model there is 757 and 340 respectively. Anway, I try counting the Model with using the technique set analysis:

Count(ALL {<Product = {'*'} Model)


But I get 757 as the total #, which is not what I want, it should add up to be 802. I did it another way but creating a table and having an expression to set every line to 1 and do the sum of that and I get 802. My question is, is there a function in qlikview that allows me to count every single line items, even the ones that are null?

4 Replies
Not applicable
Author

There is a nullcount expresion.

NullCount( [{set_expression}] [ distinct ] [ total [<fld {, fld}>] ]expression | field)


count(all{<Product = {'*'} Model) + nullcount(all{<Product = {'*'} Model)


there maybe and probably a better way of doing this... 🙂

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I doubt if you need Set Analysis for your purpose... If I understand it correctly, one of the two fields is sometimes equal to null(), but you simply want to count all the lines, no matter what - missing or duplicate. How about counting concatenated values:

count(Product&Model) - this way, you should get 802. Use qualifier "ALL" if you also need to ignore selections.

cheers,

Oleg

Not applicable
Author

Hey Oleg,
Thanks alot, I tried using count(Product&Model) and I get 0. Any reason why?

Thanks for the help.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP