Hello,
Hope you can assist me. I am trying to calculate weighted avg in the field based only on certain values. The field contains response ratings received from the survey between 1-5. I am trying to calculate weighted % only for responses with ratings 4 and 5. Would you please direct me to what expression formula can be used for this?
7 1214
Create a Query restricting Response Ratings to 4 and 5 only, then apply Weighted Averages to the Result Set. To restrict Response Ratings: - SELECT Table1.*, Table1.[Response Ratings]
-
FROM Table1
-
WHERE (((Table1.[Response Ratings])=4 Or (Table1.[Response Ratings])=5));
Thank you. I am relatively new to Access. In the query that I already have I have 5 fields where responses can be 4 and 5. So I need to be able to weight avg each of the field on 4 and 5 responses. Also, is there a way to write this as formula in expression builder since I needs this to be calculated on the report?
Need greater detail along with some sample Data...
Here is the extract from the query I use for the report. What I am trying to accomplish to get weighted averages for each of the category with numbers on the sheet and base weighted avg % only on responses with ratings 4 and 5. More so, I need to do also weighted averages for:
1.For each Field (with response ratings)
2.For overall of all responses across fields with 4 and 5 ratings for each Company Name field
3.For overall for all responses across all fields for all companies per SVP.
All based only on responses with 4 and 5 ratings.
Not sure if this is confusing.... - Report DateAM SVP DeptIDCompany NameTravelerNameDKNumberPNRNNumberField1Field2Field3Field4Field5
-
14-Oct-13 Name1 521745 XYS Name1 3351000101 GGGG 5 5 5 5 5
-
14-Oct-13 Name2 521210 ABC Name2 3462000001 VVVV 3 5 5 4 4
-
14-Oct-13 Name3 104455 XXC Name3 6791000101 UUUU 5 5 5 5 5
-
14-Oct-13 Name4 161130 CGF Name4 7490060506 UUUU 5 5 5 5 5
-
14-Oct-13 Name5 523530 BKH Name5 3841000101 QQQQ 5 5 5 5 5
-
-
zmbd 5,501
Expert Mod 4TB
Yoni Hasid:
Please be aware of the fact that attachments are not often downloaded by our experts/moderators for several reasons. In my case, my company's IT-Security policy prohibits doing so.
Instead, would you mind taking a small subset of your data in the Excel file and cut-n-paste. If you use the [CODE/] format button to place the [code] tags, the text will retain the intended spacing (with some minor tweaks (^_^) )
The other thing that will help will be to see the actual SQL in your query. If you will open the query in design mode, right-click in the table area, and select the SQL-View option. You will be taken to a view with the actual SQL behind the query. Please cut-n-paste this in a post, select the text and format it using the [CODE/] format button to place the [code] tags around the SQL text.
Please let me know if the data sample makes sense.
There are several Algorithms that compute Weighted Averages and quite honestly I am a little confused as to exactly what you are looking for. What I did was to compute the Average of Fields1...Field5 and return an Integer Value. The only requirements are that Fields1...Field5 cannot be NULL and that they are Integer Values. - Table1:
-
SomeName Field1 Field2 Field3 Field4 Field5
-
ABC 13 12 40 20 15
-
DEF 123 561 987 444 334
-
- Function definition:
-
Public Function fCalcAvg(lngF1 As Long, lngF2 As Long, lngF3 As Long, lngF4 As Long, lngF5 As Long) As Integer
-
fCalcAvg = ((lngF1 + lngF2 + lngF3 + lngF4 + lngF5) / 5)
-
End Function
-
- SQL:
- SELECT Table1.SomeName, Table1.Field1, Table1.Field2, Table1.Field3, Table1.Field4, Table1.Field5,
-
fCalcAvg([Field1],[Field2],[Field3],[Field4],[Field5]) AS Average
-
FROM Table1;
- Query Results:
-
SomeName Field1 Field2 Field3 Field4 Field5 Average
-
ABC 13 12 40 20 15 20
-
DEF 123 561 987 444 334 490
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andy |
last post by:
Hi!
Is possible to do xml validation of one xml block based on values from
another xml block?
For example, I have an input xml file containing account types.
<Root>
<AccountTypes>...
|
by: Bob Alston |
last post by:
I am still looking for MS Access based software for managing client
services for a basic human needs agency. These agencies I am working
with provide food, clothing, personal care items and...
|
by: Bob Rock |
last post by:
Hello,
I'd like to programmatically access keys and values of on .resources file
embedded in my assembly.
I've seen that the assembly class provides the GetManifestResourceStream
method .......
|
by: sklett |
last post by:
I'm not real experienced with asp.net so this may be obvious.
I've got a situation where some of my client side javascript is causing my
posted form's controls to lose their values.
In other...
|
by: Rajasuds |
last post by:
I have a question in MS Access
I have two tables
MASTER with Fields 1, Field 2, Field 3
TRANS with Field1, Field 2, Field,10
I need to set up a look up condition where, I need !Field 2 to...
|
by: gretchen |
last post by:
I'm a fairly new access user so my question may be simple but I still need help! I have a form and a subform. I want to run an append query and populate the subform based on values in the form. I...
|
by: BerkshireGuy |
last post by:
I have two functions that calculate two numbers based on based in
parameters. So, the functions return a value.
Is there a way to create a chart based on values from a function?
The only...
|
by: Gyanchand |
last post by:
Need to generate a word document using a template in ASP by inserting certain values at runtime.
Can sum1 plz. help me figure out how can you write to a word file...
tried using...
|
by: damola |
last post by:
Good day everyone
Please how can i prevent access to certain forms in ms access database 2007.
i want it to be in such a way that when i enter user login,it automatically detects the forms the user...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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...
|
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...
| |