Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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?

1 Solution

Accepted Solutions
MVP
MVP

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.

View solution in original post

17 Replies
MVP
MVP

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

hi,

     Try this, it gives number of product in a category

     =Count(Distinct Product)

Hope it helps

Thanks & Regards,
Mayil Vahanan R
Not applicable

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

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

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

Add the partial sum to your first dimension.

Not applicable

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

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

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