Solved

Cummulative Line chart

Posted on 2003-11-10
6
295 Views
Last Modified: 2008-03-10
Hi Guys,

I have a table with three fields, Weeknno, Office and Cases. I want to produce a line chart that shows the cumulative total number of cases for each office over the weeks. For example, if I have 3 offices, each office would have a different line represented on the graph showing its growing total number of cases over a period of time. Th einformation is currently stored in a table like:

Weekno |  Office  | No Cases
01         | London |  26
01         | Paris    |  32
02         | London | 14         (cumulative total would be 40)
02         | Paris     | 4          (cumulative totla would be 36)

.. and so on...

Is it posssible to do this?

Many thanks

Ensa
0
Comment
Question by:ensa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 9

Expert Comment

by:svenkarlsen
ID: 9715287
Hi ensa,
You can make a query like this to create the accumulated figures to base your graph on:

SELECT tbl.WeekNo, tbl.office, DSum("[No Cases]","tbl","WeekNo <= " & [WeekNo] & " AND [office]=" & [office]) AS AccCases
FROM tbl
ORDER BY tbl.WeekNo, tbl.office;


Kind regards,
Sven
0
 

Author Comment

by:ensa
ID: 9715437
Hi Sven,

Thanks for the prompt reply. Unfortunatly, the output produces #error, when I try this. When I mouse over the column a msgbox says 'The object doesn't contain the automation object' and then displays the name of the office. All the fields and table name are spelt correctly. Any ideas?

Thanks again

Ensa
0
 
LVL 9

Expert Comment

by:svenkarlsen
ID: 9715540
Ensa,

could you post the query you've made here as SQL, please ?

Sven
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ensa
ID: 9715607
Sven,

SQL below as you posted with the table entered.

SELECT CSOfficesTab.WeekNo, CSOfficesTab.office, DSum("[No Cases]","CSOfficesTab","WeekNo <= " & [WeekNo] & " AND [office]=" & [office]) AS AccCases
FROM CSOfficesTab
ORDER BY CSOfficesTab.WeekNo, CSOfficesTab.office;



Ensa
0
 

Author Comment

by:ensa
ID: 9715652
Hi Sven,

Sorted it!

Correct SQL needed single quotes round in the Dsum ie.

SELECT CSOfficesTab.Weekno, CSOfficesTab.OFFICE, CSOfficesTab.[No Cases], DSum("[No Cases]","CSOfficesTab","WeekNo <= '" & [WeekNo] & "' AND [office]='" & [office] & "'") AS AccCases
FROM CSOfficesTab
ORDER BY CSOfficesTab.Weekno, CSOfficesTab.OFFICE;


Now working perfectly. Many thanks for your help.

Ensa
0
 
LVL 9

Accepted Solution

by:
svenkarlsen earned 250 total points
ID: 9715844
hmmmm, - could try this:

SELECT CSOfficesTab.WeekNo, CSOfficesTab.office, DSum("[No Cases]","CSOfficesTab","WeekNo <= " & CSOfficesTab.WeekNo & " AND [office]='" & CSOfficesTab.office & "'") AS AccCases
FROM CSOfficesTab
ORDER BY CSOfficesTab.WeekNo, CSOfficesTab.office;


Sven
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question