Cross tab query

A

Andre Adams

TRANSFORM Sum(tblDailyTradeFile.[Transaction Amount]) AS [SumOfTransaction
Amount]
SELECT tblDailyTradeFile.[Account Description],
tblDailyTradeFile.[Income/Expense], Sum(tblDailyTradeFile.[Transaction
Amount]) AS [Total Of Transaction Amount]
FROM tblDailyTradeFile
GROUP BY tblDailyTradeFile.[Account Description],
tblDailyTradeFile.[Income/Expense]
PIVOT tblDailyTradeFile.[Job ID];

The above is a cross-tab query that involves a simple table being merged
into one spreadsheet in crosstab view. I've created a table the has the
following parameters.

Account Description (Amount Description)
Transaction Amount (Amount of the Description)
Job ID (Which division within the firm)
Income/Expense

What I'm trying to do is get a total for each Job ID and sort them by
Income/Expense. My problem comes when I try to add the following equation.
(Now, the crosstab query will work for me when I do the above.) But, how
would I add this.

Take one of the Job I.D's called "Firmwide". This is the Income and Expense
that needs to be included every other Job I.D's total. So, If I have 7 Job
ID's and firmwide is the 8th, I need to (from that particular description)
take the total firmwide and divide it by 7 and add it into the other Job ID's
for that Description. Here is an example where Firmwide would have been
3,750 under 3 categories:

Account Desc --- Income/Expense---Equity Sales---Firmwide---Local---Municipal

Before.......
Gain/Loss Income 300 3750
200 5000

After
Gain/Loss Incom 1550 0
1450 6250

Is it possible to divide this total firmwide number and add it to what's
already populated for my other Job I.D's?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top