Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Show percentage in pivot table

Hi all

I want to do a pivot table with two dimension: year and age.

I want to show the percentage of people in a certain age-group within every year for the people in my population with foreign nationality, like this:

pivot.png

I know how to calculate the number of people within each group using the function

     =count( {< [Nationality]={'Udenlandsk'} >} Person_id)

But how do I get QV to show the percentage in stead, like in the example above?

I already tried:

     = count( {< [Nationality]={'Udenlandsk'} >} Person_id) /     count(total  {< [Nationality]={'Udenlandsk'} >} Person_id)

But this doesn't give the percentage I want.

Kind Regards

Maria

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Use the TOTAL qualifier with a field list:

   = count( {< [Nationality]={'Udenlandsk'} >} Person_id) /     count(total<year>  {< [Nationality]={'Udenlandsk'} >} Person_id)

assuming year is the field name for your year dimension.

View solution in original post

2 Replies
swuehl
MVP
MVP

Use the TOTAL qualifier with a field list:

   = count( {< [Nationality]={'Udenlandsk'} >} Person_id) /     count(total<year>  {< [Nationality]={'Udenlandsk'} >} Person_id)

assuming year is the field name for your year dimension.

Anonymous
Not applicable
Author

This was just what I was looking for. Thanks a lot!