Calculation based on results of 2 expressions

I have a field called Reoffense Counter and a field called Counter, where 
Counter is the total count of all the records, and Reoffense Counter is the 
total of only those records where a new offense has taken place.  Each of 
these fields contains a "1" where appropriate, so they can be counted.  I 
want to find out what percentage of the records contain a Reoffense, so I 
think I would want to divide Reoffense Counter by Counter.  I haven't been 
able to come up with the correct expression to use in my report.  Can you 
help?
0
Utf
4/13/2010 6:25:01 PM
access.reports 4434 articles. 0 followers. Follow

5 Replies
688 Views

Similar Articles

[PageSpeed] 5

In this query use your table and field names --
SELECT Sum([Reoffense Counter]) / Sum([Counter]) * 100 AS [Re-offend Percent]
FROM YourTable;
-- 
Build a little, test a little.


"MarthaNH" wrote:

> I have a field called Reoffense Counter and a field called Counter, where 
> Counter is the total count of all the records, and Reoffense Counter is the 
> total of only those records where a new offense has taken place.  Each of 
> these fields contains a "1" where appropriate, so they can be counted.  I 
> want to find out what percentage of the records contain a Reoffense, so I 
> think I would want to divide Reoffense Counter by Counter.  I haven't been 
> able to come up with the correct expression to use in my report.  Can you 
> help?
0
Utf
4/13/2010 6:53:02 PM
Thank you, Karl.  I tried entering this as a query and I also tried inserting 
it into a text box as an expression in the report, but I keep getting a 
Syntax Error.  Perhaps there is something missing that my inexperience 
doesn't make clear to me?

"KARL DEWEY" wrote:

> In this query use your table and field names --
> SELECT Sum([Reoffense Counter]) / Sum([Counter]) * 100 AS [Re-offend Percent]
> FROM YourTable;
> -- 
> Build a little, test a little.
> 
> 
> "MarthaNH" wrote:
> 
> > I have a field called Reoffense Counter and a field called Counter, where 
> > Counter is the total count of all the records, and Reoffense Counter is the 
> > total of only those records where a new offense has taken place.  Each of 
> > these fields contains a "1" where appropriate, so they can be counted.  I 
> > want to find out what percentage of the records contain a Reoffense, so I 
> > think I would want to divide Reoffense Counter by Counter.  I haven't been 
> > able to come up with the correct expression to use in my report.  Can you 
> > help?
0
Utf
4/13/2010 7:29:01 PM
In query design view use this as a calculated field --
     Re-offend Percent:   Sum([Reoffense Counter]) / Sum([Counter]) * 100 

-- 
Build a little, test a little.


"MarthaNH" wrote:

> Thank you, Karl.  I tried entering this as a query and I also tried inserting 
> it into a text box as an expression in the report, but I keep getting a 
> Syntax Error.  Perhaps there is something missing that my inexperience 
> doesn't make clear to me?
> 
> "KARL DEWEY" wrote:
> 
> > In this query use your table and field names --
> > SELECT Sum([Reoffense Counter]) / Sum([Counter]) * 100 AS [Re-offend Percent]
> > FROM YourTable;
> > -- 
> > Build a little, test a little.
> > 
> > 
> > "MarthaNH" wrote:
> > 
> > > I have a field called Reoffense Counter and a field called Counter, where 
> > > Counter is the total count of all the records, and Reoffense Counter is the 
> > > total of only those records where a new offense has taken place.  Each of 
> > > these fields contains a "1" where appropriate, so they can be counted.  I 
> > > want to find out what percentage of the records contain a Reoffense, so I 
> > > think I would want to divide Reoffense Counter by Counter.  I haven't been 
> > > able to come up with the correct expression to use in my report.  Can you 
> > > help?
0
Utf
4/13/2010 9:32:01 PM
For some reason, I keep getting error messages.  I'm probably trying to enter 
the expression in the wrong place.  In query design view, is this expression 
placed in the "Field" row or in the "Criteria" row?  Thank you for your 
patience.

"KARL DEWEY" wrote:

> In query design view use this as a calculated field --
>      Re-offend Percent:   Sum([Reoffense Counter]) / Sum([Counter]) * 100 
> 
> -- 
> Build a little, test a little.
> 
> 
> "MarthaNH" wrote:
> 
> > Thank you, Karl.  I tried entering this as a query and I also tried inserting 
> > it into a text box as an expression in the report, but I keep getting a 
> > Syntax Error.  Perhaps there is something missing that my inexperience 
> > doesn't make clear to me?
> > 
> > "KARL DEWEY" wrote:
> > 
> > > In this query use your table and field names --
> > > SELECT Sum([Reoffense Counter]) / Sum([Counter]) * 100 AS [Re-offend Percent]
> > > FROM YourTable;
> > > -- 
> > > Build a little, test a little.
> > > 
> > > 
> > > "MarthaNH" wrote:
> > > 
> > > > I have a field called Reoffense Counter and a field called Counter, where 
> > > > Counter is the total count of all the records, and Reoffense Counter is the 
> > > > total of only those records where a new offense has taken place.  Each of 
> > > > these fields contains a "1" where appropriate, so they can be counted.  I 
> > > > want to find out what percentage of the records contain a Reoffense, so I 
> > > > think I would want to divide Reoffense Counter by Counter.  I haven't been 
> > > > able to come up with the correct expression to use in my report.  Can you 
> > > > help?
0
Utf
4/14/2010 1:31:01 PM
Karl - Please disregard my previous message.  I'm not sure what I was doing 
wrong yesterday, but I went back and created the calculated field in the 
report design view, and it works now.  Thanks so much for all your help!

"MarthaNH" wrote:

> For some reason, I keep getting error messages.  I'm probably trying to enter 
> the expression in the wrong place.  In query design view, is this expression 
> placed in the "Field" row or in the "Criteria" row?  Thank you for your 
> patience.
> 
> "KARL DEWEY" wrote:
> 
> > In query design view use this as a calculated field --
> >      Re-offend Percent:   Sum([Reoffense Counter]) / Sum([Counter]) * 100 
> > 
> > -- 
> > Build a little, test a little.
> > 
> > 
> > "MarthaNH" wrote:
> > 
> > > Thank you, Karl.  I tried entering this as a query and I also tried inserting 
> > > it into a text box as an expression in the report, but I keep getting a 
> > > Syntax Error.  Perhaps there is something missing that my inexperience 
> > > doesn't make clear to me?
> > > 
> > > "KARL DEWEY" wrote:
> > > 
> > > > In this query use your table and field names --
> > > > SELECT Sum([Reoffense Counter]) / Sum([Counter]) * 100 AS [Re-offend Percent]
> > > > FROM YourTable;
> > > > -- 
> > > > Build a little, test a little.
> > > > 
> > > > 
> > > > "MarthaNH" wrote:
> > > > 
> > > > > I have a field called Reoffense Counter and a field called Counter, where 
> > > > > Counter is the total count of all the records, and Reoffense Counter is the 
> > > > > total of only those records where a new offense has taken place.  Each of 
> > > > > these fields contains a "1" where appropriate, so they can be counted.  I 
> > > > > want to find out what percentage of the records contain a Reoffense, so I 
> > > > > think I would want to divide Reoffense Counter by Counter.  I haven't been 
> > > > > able to come up with the correct expression to use in my report.  Can you 
> > > > > help?
0
Utf
4/14/2010 1:38:10 PM
Reply:

Similar Artilces:

Procedure to calculate distance using latitude/longitude
Does anyone know of a vba procedure for access that will calculate straightline distance using latitude and logitude for 2 points? AJ wrote: > Does anyone know of a vba procedure for access that will calculate > straightline distance using latitude and logitude for 2 points? See: http://groups.google.com/group/microsoft.public.access/msg/6b934b0e580b974b James A. Fortune MPAPoster@FortuneJames.com ...

Insert text in Cell A1 based on keyword criteria
I want to populate cell A1 with specific text (the word "Active") whenever the word "Yes" is found in cells A2:A20. Whenever the word "Yes" is not found in cells A2:A20 I want to leave cell A1 blank. <twlove@ontuet.com> wrote in message news:1150210856.375367.146410@c74g2000cwc.googlegroups.com... >I want to populate cell A1 with specific text (the word "Active") > whenever the word "Yes" is found in cells A2:A20. Whenever the word > "Yes" is not found in cells A2:A20 I want to leave cell A1 blank. =IF(COUNTIF(A2:...

SDK integration in VS2005 #2
In my MFC application I have resources in german as default and in english, all included in the .exe. Whenever the program runs under a german version of the OS it appears in german if it runs on any other language it should come up in english. I'm using this code: #ifdef FORCE_ENGLISH_US lcidUser = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); #else lcidUser = GetUserDefaultLCID(); #endif LANGID langid = LANGIDFROMLCID(lcidUser); if (PRIMARYLANGID(langid) != LANG_GERMAN) { LCID lcidUsEnglish = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_D...

Calculating Taxes and Making calculations
Hello, Kindly plz tell me how do i go about making some small calculations based on my existing data such as how to compute taxes and do other calculations based on some quantitative data. where exactly do i make modifications on my application??? Kindly help me out. Thanks , swati you can add code in javascript behind dropdowns or piclist fields. One example might be a dropdown which has shipping options ie ups, fedex etc. When you choose one it takes the weight of your package (whcih you enter) then calculates a shipping cost. search the archives of this group at groups.google.com and ...

Autoarchiving #2
Our company has windows 2000, we have emails that after seven days are no longer needed, I have all the folders archiving features set to how we want, but is there any way for Outlook to "auto"archive without closing and starting up outlook or going to File: archive? It would be great to not have to do either since we do not shut down the machine. Please post any answers or suggestions. Thank you You should be able to set Outlook to AutoArchive every day, or however often you like (1 day is the minimum)...this would be done through the global AA settings in Tools | Options |...

Windows Mail on 2 computers
Is it possible to run the same e-mail account in Windows Mail on 2 computers and synchronise the two? I use Vista Home Premium on a desktop and laptop which are networked wirelessly through a Netgear router. Any ideas gratefully received. You can setup the account on both computers and under Tools | Accounts | Mail | Properties | Advanced set both to leave a copy of the messages on the server so both will receive all the messages and set one computer to delete them after a few days to ensure your mailbox on the server doesn't fill up. Then you will have the received emails...

NDR in 2 Exchange Servers 2003 on 2 domains
Hi, 2 Exchange servers 2003. 2 domains. a.fr and b.fr. The Active Directory domain is xxx.local. Each domain is hosted on a distinct server, on the same Exchange organization. When an email arrives from outside the non delivery receipt is sent from postmaster@xxx.local. As almost every MTA now is checking if the 'from' belongs to a valid domain, this does not work. It is possible to change the NDR originator to postmaster@a.fr or postmaster@b.fr. But this is valid for the whole organisation. And I need the a.fr server to answer with postmaster@a.fr and the b.fr server answer from po...

Outlook Express Attachments
A friend of mine has received an email with an attachment but the paper clip icon is greyed out so they cannot view the attachment. Any suggestions? ...

How to calculate age of a person?
Hi, I'm struggling to figure this one out. I have a date column and I'd like to be able to calculate the age without doing it in my head. I've tried to do this but am struggling. Any help will greatly appreciated. Thanks Suzanne Visit www.cpearson.com and search for DATEDIFF best wishes -- Bernard V Liengme Microsoft Excel MVP www.stfx.ca/people/bliengme remove caps from email "Grd" <Grd@discussions.microsoft.com> wrote in message news:6BFFD11C-AECB-4837-93B6-D84B6170B975@microsoft.com... > Hi, > > I'm struggling to figure this one out. I have...

OWA Attachments #2
Hi Exchange 2003 SP1, Windows Server 2003 When users are using OWA externally I want them to be able to open any attachments, but block them from being able to send attachments. Is this possible? if so what is needed. Thanks RajiA ...

Sending #2
When I send an email from other then the NEW EMAIL link, the email sit in the outbox. This includes a send from IE, ACT contact databas program, sometimes other places. The Microsoft forums produce n responses. Thank you ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com ...

Preventing Blank based on another Cell
I would like to validate data but cant quite get the formula right. I have a cell (say F7) that cannot be blank if (say E7) another cell equals a text value (say "S"). Anyone have an idea? I am stumped at this seemingly easy task. I forgot to add the valid combinations: E7 = P and F7 = Entry: OK E7 = P and F7 = Blank: OK E7 = S and F7 = Entry: OK E7 = S and F7 = Blank: INVALID bluegrassstateworker wrote: > I would like to validate data but cant quite get the formula right. I > have a cell (say F7) that cannot be blank if (say E7) another cell > equals a text value (sa...

CRM 1.2 Console Logon Problem
Folks, I have CRM 1.2 installed on a SBS 2003 Premium server with the SBS SP1 installed, the default port number for the site is 83 and not 80 as it would conflict with another product. I have created a link for users with the port number in and this works fine from client machines, but if I use the server console to try and access the same site an authentication box appears and will not accept my credentials (Administrator) and then fails with you do not have permission to access this site. The same happens if I try and use the Deployment Manager. If I log on to a client Workstation...

EXCEL 2007 Formula to calculate INTEREST only on a 3 month bridge
I am trying to calculate monthly INTEREST ONLY payment on a short term bridge/swing loan. Assuming an interest rate of 2.75%, paid monthly, Also assuming it will be required for a 3-6 month period, amount approx $500,000. Just switched to Excel 2007 but don't seem to be able to calculate using the formula builder. Not sure if it is compounded daily or monthly. You might want to check out the IPMT function. From the XL help file: IPMT(rate,per,nper,pv,fv,type) Rate is the interest rate per period. Per is the period for which you want to find the interest and must...

Due Date Calculated
I need assistance on an expression that allows for the due date of recurring training to be one year from date completed. Details are as follows: I have a form named [frmTRNComplete] based on table named [tblTRNComplete] Form controls are: TRNID (combo box), DateComp (Text Box) , DateNext (text box), Reccuring (check box) I would like the DateNext to be 1 year from DateComp if Reccuring is true and Date next to be blank if Reccuring is false. -- Aloha, Ron A. Ron I'll assume that you want to use the form to calculate the DateNext, and that you are not trying to s...

Attachment Line #2
In Outlook my attachments are included within the body of the message, they used to be included within an attachment line, how do I change back to this ?? Outlook 2002 - SP3 Regards Paul Stringer Paul Stringer wrote: > In Outlook my attachments are included within the body of the message, they > used to be included within an attachment line, how do I change back to this > ?? > > Outlook 2002 - SP3 > > Regards > > Paul Stringer > > Change your email format from RTF to HTML.... ...

Increasing CRM Idle Timeout - Forms based authentication
We are using crm in a hosted environment - with forms based authentication. How can the default timeout of 10-20 minutes be increased?? I have increased the 'session state' timeout, but it does not help. Users still have to re-login after 20 mins of innactivity. Thanks!!! ...

Counting Occurrences with 2 columns
Hello! I am trying to calculate the occurence of one item based on tw criterias: Column A: Name of Magazine(e.g. "Red", "Blue", "Green" ) Column B: Frequnecy read (4,5,8)range from 1-20 Column C: "Read" OR "Not Read" e.g Red 4 Read Blue 5 Not Read Green 6 Read Yellow 2 Read Red 3 Not Read What I need to find out is: How many many times each magazine was read ? Thank yo -- Message posted from http://www.ExcelForum.com Suppose your data is in Sheet1 in A2:C6 > Red 4 Rea...

how to calculate outliers
Google is your friend: http://www.google.com/search?q=calculate+outliers - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "ismhs" <ismhs@discussions.microsoft.com> wrote in message news:035124A0-06FA-4153-932E-6C4E0614F38C@microsoft.com... > ...

transaction number #2
hi all while generating detailed sales report in mrms 1.3 we select transaction number to view journal of that particular bill,we find correct details in journal. But when we see in detailed sales report , we find items which are not a part of that journal displayed under transaction #. Is there query any problem in detailed sales report query in qrp reports. Rizwan, Have you tried to reindex the database? It's in the RMS Administrator under the database menu. Are you having any other issues with the software? Daniel techs1@nurol.com NuRol Point of Sale www.nurol.com 404-352-...

Limit choices in one cell dependent based on choice in other cell
Does anybody know if and how to limit the choices in one cell (from a list) based on the choice (from a list) in another cell? For example, if (from a list) they pick "Customer Communication" in say column M, they would only get the choice of three issues (instead of the entire list) in column N. Thanks! Mahaas Debra Dalgleish shows how to use dependent lists with data|validation here: http://contextures.com/xlDataVal02.html michelle.haas@xerox.com wrote: > > Does anybody know if and how to limit the choices in one cell (from a > list) based on the choice (from a list) ...

Same Sender Multiples Email #2
Did you check to see if these users have rules to forward? The answer is Yes Are these users in these DL's contain both external and internal users? Yes Also were you able to check the message ID's to see if they are indeed duplicates? The answer is also Yes Is there a utility or configuration setup to filter those msgs? Thanks a lot for the help "jamestechman@gmail.com" wrote: > Did you check to see if these users have rules to forward, if not did > at one point have rules that forwarded? Also someone asked if these > senders in the DL's were external or i...

Calculated field options???
Here's my Data: Country Status --------- ---------- Canada Green Canada Blue Canada Green Canada Green Canada Blue In my pivot table, 'Country' is an item, and 'Status' is my only data field. What I really need to show in my data area is two column of data, one for 'Green' and one for 'Blue'. I tried creating two 'Calculated' fields with the following formulas, but they don't seem to be working: 'CalculatedField1' = IF((STATUS="Green"),1,0) 'CalculatedF...

tenure calculations
how can I format several dates such as 04/19/2003, 04/01/2004, etc. int a yearly average for the employee tenure -- Message posted from http://www.ExcelForum.com right now say I have my yearly figures in i1-i9. The formula I though would work is =today()-average(i1:i9), but how would i format this to give me yearly read out -- Message posted from http://www.ExcelForum.com Hi djackson! One way is to use YEARFRAC with a third argument of 1 to get your tenures in years and fractions of a year and then average the result. However YEARFRAC does produce some annoying but small errors. Y...

Time Sheet Function to Calculate
I am having some trouble trying to establish a formula that will give me the number of hours worked during the day given the start time say 8.30am with an end time of 5.30pm and say 30 minutes for lunch. For this scenario, total working hours would be eight and a half hours but I need Excel to display this result as 8.30 hours (0.30 being the minutes in the half hour) and not 8.50. Can someone suggest what to do? Typically the layout would be Column A - Start Time say 8.30am Column B - Time in minutes spent at lunch say 30 minutes Column C - End Time say 5.30pm. Column D - the calculati...