Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

count number of rows per category in pivot table

hi guys,

i have a pivot table with this hierarchy

category
   product
     total

i wish a column which shows the number of products for each category. can you redirect me to a thread if my question is a duplicate?

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: count number of rows per category in pivot table

B1-2 seems to me a subset of B1-1 when I look at the table where you link Z3ARGOS_BLOC to PLANIF.

So the numbers seems ok to me.

16 Replies
MVP
MVP

Re: count number of rows per category in pivot table

You probably need to look into using the total qualifier with a field list (check the Help for this), like:

=count(total<category> product)

Hope this helps,

Stefan

Re: count number of rows per category in pivot table

hi,

     Try this, it gives number of product in a category

     =Count(Distinct Product)

Hope it helps

Not applicable

Re: count number of rows per category in pivot table

hi stefan,

i have tried using the count(total<category> product) but its not good:

here is a sample of what i am trying to achieve:

categorySubcategoryproducttotal products
AXAX11
AXAX21
total products 2
AZAZ1
total products 1
BM41
BM51
total products 2
BO61
total products 1

can you help me?

MVP
MVP

Re: count number of rows per category in pivot table

In my expression, category and product must be field names, not e.g. column labels.

Your above table shows what you want to achieve or what you see in real life using my expression?

If that's what you want to achieve, I think you should maybe use mayilvahanan's expression count(distinct product) and add a partial sum in presentation tab for your first dimension.

If this does not help you, could you upload a small sample?

Not applicable

Re: count number of rows per category in pivot table

my expression is count(distinct product) (label>>"Total")

but when i go to presentation tab> i cannot add partial sum to "Total"

why is that?

MVP
MVP

Re: count number of rows per category in pivot table

Add the partial sum to your first dimension.

Not applicable

Re: count number of rows per category in pivot table

please guys can you check the file i just uploaded? my internet is a bit slow..that's why i took so much time..

its not working when i pu the partial sum on the first dimension

Not applicable

Re: count number of rows per category in pivot table

for example

when i expand BLOC1 i have B1-1 and B1-2 and i have total 264 for each.

but this is false because when i collapse BLOC1 i have 264.

MVP
MVP

Re: count number of rows per category in pivot table

Sorry, my mistake, you need to add the partial sum for the last dimension, Product.

Community Browser