Solved

Running Sum Issue

Posted on 2016-10-06
7
35 Views
Last Modified: 2016-10-07
Hello experts,

I am trying have running sum based on category but I keep getting overall running sum. I attached a photo for reference. Tool number is text. ShiftEnd is date. Output is number. Please help.
Capture.PNG
0
Comment
Question by:Kai Lee
[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
  • 4
  • 2
7 Comments
 
LVL 38

Accepted Solution

by:
PatHartman earned 250 total points
ID: 41832157
What is "category"?  It isn't in the query.  If you want to restrict the DSum() add additional criteria.

Running sums should almost never be calculated in queries.  The process in Access is very expensive.  Do it in your report.  Reports are liniar and so calculating a running sum presents no problem.  If you need the report to break on something, add sorting and grouping and choose "over group" rather than "over all" for the running sum.
1
 
LVL 92

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 250 total points
ID: 41832184
I assume that "by category" you mean "running sum by [Tool Number] and [ShiftEnd]".  If so, the short answer is that both conditions have to specified in your DSum criteria.

That said, PatHartman is 100% correct: using domain aggregates in a query like this is almost always a bad idea, and should be avoided.  Doing this in  a report is fairly trivial.  If you must have this do this in a query, I would do it as a self-join.
1
 

Author Comment

by:Kai Lee
ID: 41832202
Thank you all for answering my question. "By category" I mean running sum by [Tool Number] and [ShiftEnd]. I used report for running sum but it still showed overall running sum when I chose "over group".
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:Kai Lee
ID: 41832218
Hello I attached another pic that shows what result what am I getting. Sorry I can't show the data. Capture.PNG
0
 
LVL 38

Assisted Solution

by:PatHartman
PatHartman earned 250 total points
ID: 41832225
You have to group by Tool in the report.  Then the running sum will be for just that tool.

In your dsum, the criteria was >= tool.  It needs to be >= ShiftID and = tool
1
 

Author Comment

by:Kai Lee
ID: 41833577
Hello Pat,

After changing to Rtotal: DSum("[Output_Tools/Shift]","[Shifts]","[Tool Number]='" & [Tool Number] & "'" And "[ShiftID]>= " & [ShiftID]) see the result
Capture.PNG
0
 

Author Comment

by:Kai Lee
ID: 41833579
I will try to use report again
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

624 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