473,385 Members | 1,292 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help - need Cross Tab to Sum AND Count

Hope someone can help me with this - I've been staring at it stupidly
for hours now, convinced there must be an easy way to achieve the
results I want:

I have a very large table recording every sale made by one of 90
salespeople (2 years of data), and the date the sale was made. I need
a report that shows a list of the salespeople down the left hand side
and then for each month the total number of sales and the total value
of sales. I can do a cross tab that works beautifully for each of
these that will group the records by month but I just can't seem to
find a way of combining the information into a useful table.

I know in an Excel Pivot table I would be able to have more than one
row for each salesperson so that I could show the value and the count
for each line but I can't seem to do this in Access. I tried a make
table query and then an append query but that jumbled up the
information into nonsense as I wasn't able to sort it by salesperson
and month.

Am I missing something really obvious here or has anyone got any
bright ideas? I need this to be a simple process that admin staff with
no knowledge of access can run.

Any help enormously appreciated,

Amanda Leslie

__________________

am****@alt1.demon.co.uk

Nov 13 '05 #1
3 2789
am****@alt1.demon.co.uk wrote:
Hope someone can help me with this - I've been staring at it stupidly
for hours now, convinced there must be an easy way to achieve the
results I want:

I have a very large table recording every sale made by one of 90
salespeople (2 years of data), and the date the sale was made. I need
a report that shows a list of the salespeople down the left hand side
and then for each month the total number of sales and the total value
of sales. I can do a cross tab that works beautifully for each of
these that will group the records by month but I just can't seem to
find a way of combining the information into a useful table.

I know in an Excel Pivot table I would be able to have more than one
row for each salesperson so that I could show the value and the count
for each line but I can't seem to do this in Access. I tried a make
table query and then an append query but that jumbled up the
information into nonsense as I wasn't able to sort it by salesperson
and month.

Am I missing something really obvious here or has anyone got any
bright ideas? I need this to be a simple process that admin staff with
no knowledge of access can run.

Any help enormously appreciated,

Amanda Leslie

__________________

am****@alt1.demon.co.uk

While there are likely other ways to do this, what I have done is create
two crosstabs, identical except one counts and the other sums. Also, I
rename the data field that will be the column in each
(newname: [oldname] + "Count"

Then in another query i simply join the two fields together by whatever
fields form the rows.

That way all of the columns of the count cross tab have a name in the
format: xxxxxCount
and all the columns of the sum cross tab have a name in the format:
yyyyySum
Hope I have stated this clearly (I get in trouble here is I mis-state
things)

Bob
Nov 13 '05 #2
Thanks Bob, that's great - and does the job.

However, I'm not sure where to put:

(newname: [oldname] + "Count"

?

Can you advise further!

Many thanks

Amanda Leslie

On Wed, 12 Oct 2005 12:59:48 -0500, Bob Alston
<tu****************@cox.net> wrote:
am****@alt1.demon.co.uk wrote:
Hope someone can help me with this - I've been staring at it stupidly
for hours now, convinced there must be an easy way to achieve the
results I want:

I have a very large table recording every sale made by one of 90
salespeople (2 years of data), and the date the sale was made. I need
a report that shows a list of the salespeople down the left hand side
and then for each month the total number of sales and the total value
of sales. I can do a cross tab that works beautifully for each of
these that will group the records by month but I just can't seem to
find a way of combining the information into a useful table.

I know in an Excel Pivot table I would be able to have more than one
row for each salesperson so that I could show the value and the count
for each line but I can't seem to do this in Access. I tried a make
table query and then an append query but that jumbled up the
information into nonsense as I wasn't able to sort it by salesperson
and month.

Am I missing something really obvious here or has anyone got any
bright ideas? I need this to be a simple process that admin staff with
no knowledge of access can run.

Any help enormously appreciated,

Amanda Leslie

__________________

am****@alt1.demon.co.uk

While there are likely other ways to do this, what I have done is create
two crosstabs, identical except one counts and the other sums. Also, I
rename the data field that will be the column in each
(newname: [oldname] + "Count"

Then in another query i simply join the two fields together by whatever
fields form the rows.

That way all of the columns of the count cross tab have a name in the
format: xxxxxCount
and all the columns of the sum cross tab have a name in the format:
yyyyySum
Hope I have stated this clearly (I get in trouble here is I mis-state
things)

Bob


Nov 13 '05 #3
am****@alt1.demon.co.uk wrote:
Thanks Bob, that's great - and does the job.

However, I'm not sure where to put:

(newname: [oldname] + "Count"

?

Can you advise further!

Many thanks

Amanda Leslie

On Wed, 12 Oct 2005 12:59:48 -0500, Bob Alston
<tu****************@cox.net> wrote:

am****@alt1.demon.co.uk wrote:
Hope someone can help me with this - I've been staring at it stupidly
for hours now, convinced there must be an easy way to achieve the
results I want:

I have a very large table recording every sale made by one of 90
salespeople (2 years of data), and the date the sale was made. I need
a report that shows a list of the salespeople down the left hand side
and then for each month the total number of sales and the total value
of sales. I can do a cross tab that works beautifully for each of
these that will group the records by month but I just can't seem to
find a way of combining the information into a useful table.

I know in an Excel Pivot table I would be able to have more than one
row for each salesperson so that I could show the value and the count
for each line but I can't seem to do this in Access. I tried a make
table query and then an append query but that jumbled up the
information into nonsense as I wasn't able to sort it by salesperson
and month.

Am I missing something really obvious here or has anyone got any
bright ideas? I need this to be a simple process that admin staff with
no knowledge of access can run.

Any help enormously appreciated,

Amanda Leslie

__________________

am****@alt1.demon.co.uk


While there are likely other ways to do this, what I have done is create
two crosstabs, identical except one counts and the other sums. Also, I
rename the data field that will be the column in each
(newname: [oldname] + "Count"

Then in another query i simply join the two fields together by whatever
fields form the rows.

That way all of the columns of the count cross tab have a name in the
format: xxxxxCount
and all the columns of the sum cross tab have a name in the format:
yyyyySum
Hope I have stated this clearly (I get in trouble here is I mis-state
things)

Bob


I use it to rename the field that I want to appear as columns.

Bob
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: News | last post by:
Folks, I need help with this task. I have a set of data that needs to be plotted on timeline chart. Example: Unit ProcStart ProcEnd Machine U1 5/5/03 6:01 5/5/03 6:04 M1 U2 ...
28
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical...
4
by: jimh | last post by:
I'm not a SQL expert. I want to be able to write a stored procedure that will return 'people who bought this product also bought this...'. I have a user table that links to a transaction table...
2
by: Badg3r | last post by:
Hello I'm fairly new to Access but remember just enough programming from school to be frustrated that I can't figure this out. I have a table with AccountNum and MonthNum (as a number from 1 to...
6
by: mutemode | last post by:
I have this query SELECT 'bracket' = CASE WHEN income BETWEEN 0 AND 49 THEN '0-49' WHEN income BETWEEN 50 AND 99 THEN '50-99' WHEN income BETWEEN 100 AND 499 THEN '100-499' WHEN income BETWEEN...
0
by: stanlew | last post by:
Happy New Year everyone! I'm new to both T-SQL and this forum. I'm currently doing an internship and my first task was to create a small program which will send an email detailing the sales of the...
2
by: senchiru | last post by:
All Pls help me writing SQL for the following scenario Table 1 COL1 Table 2 COL1 COL2 ----> FK to TAB1.COL1 (1 to many) COL3 COL4
2
by: lenygold via DBMonster.com | last post by:
Hi Everebody: I have a table: CREATE TABLE CROSS_REFERENCE (ROW# INTEGER NOT NULL ,KEY_WORD CHAR(16) NOT NULL ,QUERY_DESCR VARCHAR(330) NOT NULL ,PRIMARY KEY (ROW#,KEY_WORD)); It is a...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.