Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Take a textbox. Expression like: =Count( [First Name])
Do you get the count right?
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
Take a textbox. Expression like: =Count( [First Name])
Do you get the count right?
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.
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
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.
Thank you all for your very helpful responses.
Much appreciated
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