472,378 Members | 1,301 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to Calculate Cumulative Percent Failures?

ChaseCox
294 100+
Hi all,

I have a problem that I have been looking at for a couple days now and I can not quite get it to work.

I would like to calculate the cumulative percent failure of a certain product in my table.

:: Cumulative Percent Failure Example:
If you had 100 product shipped, and every month 10 units failed, you would have 10% failure the first month, 20% the second, and so on.

The fields in my table that I am concerned with are [Ship Year], which tells me what year the model shipped, [Model Number] which tells me which product line I am looking at, [QUANTITY] which tells me how many of the units from the product line there are (units produced), [M2F] which tells what month I am on (months to fail), and [SumOfDETAIL_QTY] which tells me how many units failed for that month.

Key factors:



  1. There is more than one product line in the table (1-30 possible)
  2. I need to only consider cumulative failures among alike product lines
I will include what I have done so far:

Here is the SQL code I am using to obtain how many of the products failed in a given month, depending on what year it shipped.

Expand|Select|Wrap|Line Numbers
  1.  SELECT Pre_Analysis.[Ship Year], Pre_Analysis.[Model Number], Pre_Analysis.M2F, Sum(Pre_Analysis.DETAIL_QTY) AS SumOfDETAIL_QTY, Shipping.Quantity
  2. FROM Shipping INNER JOIN Pre_Analysis ON (Shipping.[Ship Year] = Pre_Analysis.[Ship Year]) AND (Shipping.[Model Number] = Pre_Analysis.[Model Number])
  3. GROUP BY Pre_Analysis.[Ship Year], Pre_Analysis.[Model Number], Pre_Analysis.M2F, Shipping.Quantity;
  4.  
Here is a picture of what the query produces as of now
http://img.photobucket.com/albums/v7...g?t=1181073506


Any help on this matter would be greatly appreciated.
Jun 5 '07 #1
3 6771
Rabbit
12,516 Expert Mod 8TB
Is this going into a report? Just use a running sum on the report.
Jun 5 '07 #2
ChaseCox
294 100+
Is this going into a report? Just use a running sum on the report.
It would need to be in a table if possible, if not I will not worry about it.
Jun 6 '07 #3
Rabbit
12,516 Expert Mod 8TB
What about multiple subqueries? One to get the total sum and one to get the sum up to that date.
Jun 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Yannick Turgeon | last post by:
Hello all, I've got a query which suddently became very slow. It now takes about 10 secs instead of 2 secs. I've got to identical DB (one is for test and the other is production). The query...
4
by: Matt Larkin | last post by:
I am pulling my hair out trying to solve this one (presumably because I am not particularly trained or skilled at access!) I have a query which summarises the variances that each of my sales...
4
by: cefrancke | last post by:
Are there any ways to speed up a Cumulative sum in a query or perhaps another faster way to have a cumulative sum column (call a vba function?). For example, I want to sum up all values under...
4
by: Bill | last post by:
I have two long values that are passed in an event. I would like to calculate percent complete as an int but am not quite sure how. Do I need to convert them to doubles and then use the Math class...
4
by: dmisen | last post by:
I have data on air pollution coming from sources across the country, and control options for reducing pollution from each source. The example below shows data for: - 2 sources (plant_ID "001" and...
6
by: Programador | last post by:
I'm getting this error when running this program: Cannot calculate rate using the arguments provided Module Module1 Sub Main() Rate(360, -694.44444444444446, 244274.69178082192) End Sub
2
by: bartsimpson8882002 | last post by:
I was wondering if scipy/numpy has the inverse cumulative normal function, ie the function f in this expression f(scipy.stats.norm.cdf(1.2)) = 1.2 or more generally, a function f which fits...
5
by: cecil | last post by:
Hi All, I have a report sectioned/grouped by year with number fields (i,e attendance). I would like to calculate percent difference of attendance for each year. Thanks in advance, Cecil
0
by: Racqetsports | last post by:
Hi there, In a gradebook database, student grades must be computed from 2 scores: a Daily grade, and then scores from Assignments. Knowing about nested forms, I am requesting direction on how to...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.