Jump to content

Adding percentage column of grand total in Cross table


Gabriel Yeong

Recommended Posts

Hi all, I have the below sample data and wish to add a column in the cross table to show the % of failures over all statuses in that partiular year.

The result I wish to have is in the attached screenshot highlighted in Yellow. I am trying to figure out how to add this directly in the cross table as a column instead of adding a calculated column in the data table and summing up separately.

Also, can anyone explain what the 'over' function does

 

 

Thanks

 

 

 

 

YEAR

STATUS

 

 

2018

OTC

 

 

2017

InProgress

 

 

2017

InProgress

 

 

2017

OTC

 

 

2016

Late

 

 

2016

OTC

 

 

2016

OTC

 

 

2016

OTC

 

 

2016

OTC

 

 

2016

Late

 

 

2016

Late

 

 

2016

OTC

 

 

2016

OTC

 

 

2016

InProgress

 

 

2016

InProgress

 

 

2016

OTC

 

 

2016

InProgress

 

 

2016

InProgress

 

 

2015

OTC

 

 

2015

OTC

 

 

2015

Late

 

 

2015

Late

 

 

2015

OTC

 

 

2015

OTC

Link to comment
Share on other sites

One way of doing it is to copy the existing table and pivot it as shown below.

 

Insert a Cross table and configure it to show Year on the Vertical axis, and Column Names on the Horizontal axis. Use the following custom expression in the cell values.

Sum([inProgress]) as [inProgress],

Sum([Late]) as [Late],

Sum([OTC]) as [OTC],

Sum([inProgress]) + Sum([Late]) + Sum([OTC]) as [Grand Total],

Sum([Late]) / (Sum([inProgress]) + Sum([Late]) + Sum([OTC])) as [Late%]Format the [Late%] column to show the data in percentage.

The final result will look like this:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...