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

Create a simple table which displays count (row-count)

Greetings.

I feel rather silly asking this question, because the solution should be obvious.

But, I can't seem to get it right

I have a QlikView sheet, which has the following :

(a)  One large Table-box, which displays simple personal data :  surname, first name, email, phone, etc, etc

(b)  three Multi-boxes, each of which I use to pick the "Criteria" I use for selecting certain data from the Table-Box  (one multi-box contains YEAR (2014/2015),  the second contains MONTH (from Jan to Dec), and the third contains GENDER (male/female).

So, let's assume, I pick (respectively) :  2015..............July...........Female.

The Table-Box will show only those customers who are female, and who were entered into the database in July, 2015.

Simple, isn't it?

And here comes the hard part :  I want to add a simple Box  (Table Box, I assume), which would display the COUNT of this criteria  (meaning :  the total number of those customers who are female, July 2015)

For some reason, I can't seem to get it to work.

I have tried using Table-Box,  List-box, etc

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Take a textbox. Expression like: =Count( [First Name])

Do you get the count right?

View solution in original post

7 Replies
marcus_sommer

I assume that you have also a personal ID or something similar from each person so you could use the title from the table like: = 'Tablebox from ... ['  & count(ID) & ']

- Marcus

tresesco
MVP
MVP

Take a textbox. Expression like: =Count( [First Name])

Do you get the count right?

jonathandienst
Partner - Champion III
Partner - Champion III

You should be able to this in a text box with an expression like:

Count(Aggr(1, <tablebox field1>, <tablebox field2>, .... <table box fieldn>))

where <tablebox field1> is the first field in the table box

     <tablebox field2> is the second field...

If you list all the fields from the text box, the Aggr() will contain a virtual table that is the same as the table box (as long as you have not chosen to suppress nulls).

A simple count may not work because the table box combines all the records where the fields are alike, but the count does not.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
avinashelite

if you want the count in the report you can added an expression like

count(ID)

and enable the total that should give the result

Digvijay_Singh

Not sure if I understand it right, You could use straight table with Year, Month and Gender as Dimension and Count{<Set conditions> ID} to show total Customers.

Not applicable
Author

Thank you all for your very helpful responses.

Much appreciated

puttemans
Specialist
Specialist

Hi Stephen,

If you're only interested in the total count, then I'd go for a text object.(new sheet object -> text object)

In the window that opens, you then add the formula you want to use. In order to count correct, you need to define what variable(s) you need to combine. I'd go for e.g. = count(distinct(surname&firstname&phone)).

In this example you'd count all different combinations of these 3 variables. I'd do this to prevent e.g. you have 3 different  Jane Smith in your data. With a distinct count on surname and firstname, your result would be 1. If you add a field like phone, since it is unlikely they all three have the same phone number, your result will be 3.

Your selected fields must be pretty complete though to work like this.

Kind regards,

Johan