Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mariasdu
Creator
Creator

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.

mariasdu
Creator
Creator
Author

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