How to have a new Total Column in crosstab query

mrchonginhk

Well-known Member
Joined
Dec 3, 2004
Messages
679
I have a crosstab query that has Month as Column Header field.
So now the output columns sometimes looks like

Name/Jan/Feb/Mar

Sometimes it is

Name/Sep/Oct

I actually want another column that adds up the total for all months, ie

Name/Jan/Feb/Mar > Name/TOTAL/Jan/Feb/Mar

Name/Sep/Oct > Name/TOTAL/Sep/Oct
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
How did you create the original crosstab?

If you used the wizard it's normally added automitcally.

Anyway all you need to add is another row heading for the total column, something like this:

Sum(ENT.Procedures) AS [Total Of Procedures]

Where Procedures is the value field of the crosstab.

By the way, the reason your Name column is appearing in the middle of the months could be because of some sort of ordering 'problem'.

You can use something like this in the PIVOT clause to make sure you get the right order.

PIVOT Format([DateField],"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

That, or something similar might already be there. Perhaps it just needs adjusting.:)
 
Upvote 0
Thank you.
I found the solution myself
Just drag the value field as row field and I get it.

Have a good day.
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,476
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top