Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
mariasdu
Contributor

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
MVP
MVP

Re: Show percentage in pivot table

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.

2 Replies
MVP
MVP

Re: Show percentage in pivot table

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
Contributor

Re: Show percentage in pivot table

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