473,405 Members | 2,210 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,405 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 6865
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...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.