Queries :: Calculate Differential Between Average Earnings And Percentage Within Crosstab Query

Apr 9, 2014

I obtained data for earnings by industry for men and women over time (5 years). I developed crosstab query that showed the average earnings for men and women for the 5 years.

Now I want within this query to calculate the differential between men and womens average earnings and calculate a percentage within this crosstab query. I tried to use Expressionbuilder with little luck.

View Replies


ADVERTISEMENT

Queries :: Add Percentage Column To Crosstab Query

Apr 12, 2013

I have created a cross tab query that contains a row heading for Entity and Total Cases. I would like to have a percentage of the Case Total for Each Category as well as the count for each category. It works fine for just the counts and here is the sql behind it:

TRANSFORM Count(CASEDATA.CASESTATUS) AS CountOfCASESTATUS
SELECT IUIDCODES.CODEDESCRIPTION, Count(CASEDATA.CASETYPECODE) AS CountOfCASETYPECODE
FROM (CASEDATA INNER JOIN CASESTATUSCODES ON CASEDATA.CASESTATUS = CASESTATUSCODES.CODEID) INNER JOIN IUIDCODES ON CASEDATA.IUID = IUIDCODES.CODEID
WHERE (((CASEDATA.CASETYPECODE)=63) AND ((CASEDATA.FYSTATUS)=6 Or (CASEDATA.FYSTATUS)=7 Or (CASEDATA.FYSTATUS)=8))
GROUP BY IUIDCODES.CODEDESCRIPTION
PIVOT CASESTATUSCODES.CODEDESCRIPTION;

View 2 Replies View Related

Queries :: Calculate Percentage In Query

Apr 16, 2013

How to calculate the percentage of kilometers per order compared to the total number of kilometers per carrier.

In the attached screenshot send queries where I need formula.

Mileage on the orders of the field called "Korkma" . The formula should look like: # [Korkm] / [total kilometers per carrier] #.

I do not know how to get the total mileage driven by the carrier (the carrier is in the query in the Field Name Plate) for the month.

For example:

date 1.1.2013.,Plate:Pribus Korkm= 37
date 2.1.2013.,Plate: Pribus,Korkm=56
date 10.1.2013.,Plate: Pribus, Korkm= 70
Formula: [37]/[163] = 0,23
[56]/[163]= 0,34
[70]/[163]= 0,43

View 1 Replies View Related

Queries :: Calculate Percentage Per Passengers In Query

Apr 19, 2013

To calculate the percentage of the number of passengers in the total number of passengers per single order using query:

Code:
SELECT

Code:
A.Date, A.Plate, A.Pax, A.Agency, A.Code, IIf ([pax]> 0, Round ([Pax] / (SELECT Sum (Pax) FROM Sheet2 as B WHERE B.Date = A.Date and B.code = A.code), 2), 1) AS KOR
FROM Sheet2 AS A
ORDER BY A.Date;

Query works fine in all cases except one, and that is when the encounter a same order in one day

01/04/2013. D_1 0pax
01/04/2013. D_1 5pax

in this case the formula gives a coefficient of 1 to 0 passengers and coefficient of 1 to 5 passengers, should be given a score of 0 0 of passengers and 1 to 5 passengers

View 1 Replies View Related

Queries :: Average Calculated Field From A Previous Query - Crosstab Data Type Mismatch

Jun 3, 2014

I am trying to construct a crosstab that averages a calculated field from a previous query. It is returning a "Data Type Mismatch" message.

The field I am trying to average is a subtraction of dates to find total days. I assume my field is not a number so I have tried to wrap it in CDbl() to change the type.

The formula is

Code:
CASE_DAYS: CDbl(IIf([Actual Close Date]-[Creation Date]>=0,[Actual Close Date]-[Creation Date],""))

View 5 Replies View Related

Queries :: Calculate Moving Average - Make Table Query Type Incorrect

Aug 16, 2015

I found the attached example a while back (can't find the site again though ) and it calculates a moving average. I've hacked out the parts I need for my own work and I can create my moving average query without an issue.

However, I need to extract the MA data into a table so planned on using append. I kept getting type errors so I tried make table to see what type it was creating and it appears to be Short Text rather than a number.

I've added an extra button and Make Table query to the example.

As far as I can tell from the code, the moving average value when calculated is a Single. However, when I write it to the table, its a Short Text.

How do I make the created Table use Number Type for my calculated moving average?

Using Access 2013

View 2 Replies View Related

Queries :: Calculate Percentage On Grouped And Filtered Data

Jul 20, 2015

I'm very new to Access and I'm attempting to write an expression in a query that will calculate the % of the count of "Exchange" field (Exchange is a text field and is grouped and the count based on each unique name) where the total count is based on the filter where "Group" = 'FS' or 'S'.

The below seems to work, but there is a better way of going about this (especially if I have to add more filter criteria). I added a pic of the query I'm trying to build.

PercentofTotal: (Count([Exchange])/DCount(Count([Exchange]),"[Holdings]","[Asset Group] = 'FS' OR [Asset Group]='S'"))

View 11 Replies View Related

Queries :: Count Same And Differences / Calculate Percentage Of Number Of Same Over Total Amount

Jul 9, 2013

I am trying to count how many of the "same" and "differences", as well as calculate the percentages of the number of "same" over the total amount. To clarify, I work at a nursing home, and I need to calculate the number of people who were admitted to our facility and then to the hospital for the same diagnosis, and a different diagnosis. Then, out of the total number of people who were admitted to the hospital from our facility, I need to calculate how many of those people had the same diagnosis or a different diagnosis.

Also, I need to categorize these diagnosis by each type of diagnosis.

View 14 Replies View Related

General :: Making A Query To Calculate The Percentage Of Change?

Mar 27, 2013

I have this table

Year AvgOfValue
2005 109.061690295772
2009 106.801581389669

I have to calculate the percentage of change of the values. I have very basic knowledge. How can I make a query to calculate the percentage of change?

View 2 Replies View Related

Calculate Percentage

Mar 22, 2008

In a report, I need to calculate the percentage of clients that respond "Yes" to a question on a survey. I need to create a query that will return the count of the number of "Yes" responses, and the number of total responses.
For example, if 10 clients complete the survey, and seven respond "Yes", I need the 2 fields in the query to be 7 and 10. So far, I have only been able to do this using multiple queries.
Thank you.

View 1 Replies View Related

General :: Crosstab Average Monthly Demand

Jul 29, 2014

My database has a crosstab query that counts the number of hits by month. I have two columns that are named "Count of Material"(Frequency) and "Sum of ordered Qty"(Total ordered). I need add a colum to find the Average Monthly Demand by dividing the Total ordered/Frequency/number of months in the query. I have tried everything to make it work but can't.

View 8 Replies View Related

Using A Do Loop To Calculate Average?

Jan 17, 2014

I'm trying to understand loops but I'm not making any progress. I'm trying to write a loop to calculate the average of the past 10 Values including the current Value. This is what I have so far.There are also Fields for "Date" and "Time" if that is useful.

[code]
Dim index As Integer
Dim RollAveTotal As Long
Dim CurrentValue As Variant
Do
'There are 4 possible Grades. I only need "Grade 1"

[code]

View 2 Replies View Related

Need To Add A Column That Would Calculate Percentage

Oct 26, 2006

Does anyone know how to add a column to an existing table that would calculate percentage?

Thank you very much in advance!!!

View 3 Replies View Related

Calculate Average Waiting Time

Jan 16, 2007

Hi,

I need to calculate an average waiting time for patients waiting to be seen in an A&E dept between two dates.

I have calculated the total waiting time for each patient with the following formula

Total Waiting Time: Format([Time Arrived]-1-[Time Left Department],"Short Time").

Any help much Appreciated

View 10 Replies View Related

How To Calculate Average Time/duration

Jun 20, 2007

I hv a access mdb which contains one column as "duration", data format as hh:mm:ss, e.g. 00:02:20 - 2 mins 20secs.

How could I calulate the average of the duration?

like sum of all duration fields / the ttl no of records.

View 1 Replies View Related

General :: Calculate Average (Blank Vs Zero)

Feb 19, 2013

Currently using a lot of Power Pivot Tables which in part calculate "averages" - but when the data comes form a Query that contains a calculated field using the iff() funtion such as: Outcome: iff(Status = "P", 1,0) we end up with a lot of zeros that create a problem in calcuating a true average. In the following example 2,3,0,1,0,0 the average is "1" but if the zeros were blank the average would be "2" because the blank cells would not be counted.

Is ther a way to have something like: Outcome: iff(status = "P",1,"blank") but what I want is ether 1 or a blank cell, NOT TEXT. If we use "" for the false outcome we still have cells that look blank but are in fact text cells and are counted in calculating average.

View 6 Replies View Related

How To Calculate Average In Two Separate Fields

Oct 28, 2012

I need to calculate the average repaired time and the average response time. These are two separate fields ....

View 1 Replies View Related

Calculate Percentage Within Currency Brackets

Jan 7, 2008

Hey,

I'm unsure of how to do this one, any help would be appreciated.

The database I'm working on has around 2000 records within the parent table. These reflect projects around the world.

the child table has records on how much these projects cost.

I would like to calculate the % of projects cost less than £50,000, then, the % of projects between £50,000-£100,000 and so on.

i'm not entirely sure how to do this, anyone have any ideas?

Thanks

View 1 Replies View Related

Calculate Percentage On Access Form

May 4, 2006

Hi, Thanks in advance. I am trying to calculate percentage, it has to round to the nearest, and also if the percentage is greater than 100 then it has to write 100%.
formulae: c=(a/b)*100,
example: c=(8/3)*100 =266.66% but this is more than 100% so i need this as 100%
example2: c=(2/3)8100=66.66% but i need it to round as 67%

i've 3 controls on a form a,b,c. so c has to calculate by itself when they enter data on a and b.
thanks,
sam

View 1 Replies View Related

Reports :: Calculate Average For Each Column / Expression?

Jul 4, 2013

I have a report that comes from a query with multiple expressions. The expressions look something like this:

IIF([TimeArrive]>[TimeTriage],DateDiff("n",[TimeArrive],[TimeTriage])+1440,DateDiff([TimeArrive],[TimeTriage]))

This works great and my report gives me my columns for each expression in minutes they way it should. Now here is the question...is there a way to insert a text box for each column/expression so I can calculate the Average for each column/expression?

i.e. I want the report to show the average minutes of Expr1 and Expr2, etc at the bottom of each column.

View 2 Replies View Related

Moving Average - How To Calculate Values From Column

Aug 13, 2013

Is there any formula or any way to calculate moving average on access? What I need is to calculate a value based on data from the past 3 months:

I have following structure for example:

Column A ----- Column B -------- Column C
ValueA1 ------- Value B1 ---------

ValueA2 ------- Value B2 ---------
ValueA3 ------- Value B3 --------- =average (ValueB1, valueB2, valueB3)
ValueA4 ------- Value B4 --------- = average (valueB2, valueB3, valueB4)

My main point id how to calculate values for column C.

View 1 Replies View Related

Reports :: Calculate And Display Percentage In Columns

Nov 7, 2013

I have an Access 2009 report that displays the sums at the bottom of some columns. Is there a way to calculate and display the percentage one sum is of another?

Column1 Column2

Total 12,000 9,800
Percentage 100 % 81.7 %

View 1 Replies View Related

How To Calculate A Percentage Of Two Fields And Format Properly

Feb 11, 2013

I have two fields CountOFAppeal Description and Amount Solicited.

I just want to get the percentage of response.

So this is what I used:

=[CountOfAppeal Description]/[Amount Solicited]*100

When I go into the properties to format it to % and add decimal places I get a crazy number

2520.46% When it should be 25.20%

When I change the format to general number the decimal point is in the right place 25.20.

View 2 Replies View Related

Modules & VBA :: Calculate Percentage Of Total Proposal Amount

Dec 18, 2014

I have two numbers, i need to calculate how much percentage of one is the other. E.g

num_1 = 100
num_2 = 10
percent = 10%

Users enter a dollar amount (retainer) and my code should calculate the percent of the total proposal amount.

Actual Code

Private Sub cmdSubmit_Click()
Dim intProposalTotal As Double 'if i use interger i get "overflow" error
intProposalTotal = Nz(DLookup("ProposalTotal", "qryPropsalTotalForRetainer", "proposal_id=" & Me.proposal_id), 0)

[Code] .....

billing_retainer_percent is formatted to Percent with 0 decimals. In the actual table Type - Number, Format - Percent, Field Size - Single. What i get is 100% instead of 10%.

View 4 Replies View Related

General :: How To Calculate Percentage Of Correct Responses PER RECORD

Sep 12, 2013

What I'm looking to do is calculate the success rate (%) of compliance rates with Quality Control paperwork. Essentially, each record has 12 "check box" fields representing the different QC sheets that are submitted each day.

QCflavourChange
QCfillerOperator
QCblowMoulding
QCtorqueTest
QCnetContents
QClabeller
QCpacker
QCpalletiser
RMpreform
RMclosure
RMlabel
RMcarton

I have been able to find the code for counting the success rate of a specific type of QC sheet across multiple days worth of testing, eg:

=Sum(IIf([RMpreform]=True,1,0))])

But I have been unable to determine how I can count the total of all the successful fields listed above, across a single record.

View 7 Replies View Related

Queries :: Average Function In Query

Jul 5, 2013

I am currently designing a dashboard for my team which works on projects, I have a main table which has main fields which i use for my dashboard

Project Type,Project ID (Primary Key), Submitted by, Project Start date, Project end date, Status

The tricky part is that the raw data has projects which got started couple of years back some got closed in the previous fiscal year but some are still being worked upon..I was able to put in a where clause to only display projects whose close dates either have null value ( projects which are still being worked) and where the close dates are >= 1/1/2013. My Dashboard needs to have the below fields

Project Type, Count of Projects, Count of Closed Projects, Average days to complete, Count of Active Projects & Average Active days

I was able to get it correct except the last field Average Active days as it is displaying Average no's even against the project type which doesn't have any active projects or where the active project count is zero.

SELECT TblWO.[Operational* Categorization Tier 2], Count([TblWO]![Operational* Categorization Tier 2]) AS [Count], Avg([TblWO]![SLA in Days]) AS [Internal SLO in Days], Count([TblWO]![Closedate]) AS [No Closed Projects], Round(Avg([TblWO]![Closedate]-[TblWO]![Work Order Submit Date Time]),2) AS [Avg Close Days], [Count]-[No Closed Projects] AS [No Active Projects], Round(Avg(Date()-[TblWO]![Work Order Submit Date Time]),2) AS [Active Avg Days]
FROM TblWO
WHERE ((([TblWO]![Closedate]) Is Null Or ([TblWO]![Closedate])>=#10/1/2012#) AND (([TblWO]![Status])<>"Cancelled" And ([TblWO]![Status])<>"Rejected"))
GROUP BY TblWO.[Operational* Categorization Tier 2]
HAVING (((TblWO.[Operational* Categorization Tier 2])<>" "));

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved