Solved

Cummulative Line chart

Posted on 2003-11-10
6
296 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

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

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!

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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