473,778 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calculating score percentages within groups

3 New Member
I have problems calculating score percentages within groups.

I have created a boat program in access where the information provided is name, team, boat and score.

The first query I've done is to produce the ranking according to the score, which worked fine.

The second query is about giving 100% to the highest score per boat and then taking the percentage of that score and calculate the rest of the team scores according to that score; below is a sample of the data I have:

in team A:

Player's Name Boat Points
AA 4 175
AB 2 120
AC 1 105
AD 3 295

in team B:

Player's Name Boat Points
BA 4 180
BB 1 170
BC 2 145
BD 3 105

in team C:

Player's Name Boat Points
CA 1 150
CB 2 0
CC 4 185
CD 3 225


After performing the calculations, given that the highest score of each boat should be considered as 100% and the other ones should be a percentage of that score per boat.
I have tried various codes but none seemed to work so far.

Any ideas? suggestions?
Thanks

EC
Jun 1 '07 #1
5 2992
Rabbit
12,516 Recognized Expert Moderator MVP
I have problems calculating score percentages within groups.

I have created a boat program in access where the information provided is name, team, boat and score.

The first query I've done is to produce the ranking according to the score, which worked fine.

The second query is about giving 100% to the highest score per boat and then taking the percentage of that score and calculate the rest of the team scores according to that score; below is a sample of the data I have:

in team A:

Player's Name Boat Points
AA 4 175
AB 2 120
AC 1 105
AD 3 295

in team B:

Player's Name Boat Points
BA 4 180
BB 1 170
BC 2 145
BD 3 105

in team C:

Player's Name Boat Points
CA 1 150
CB 2 0
CC 4 185
CD 3 225


After performing the calculations, given that the highest score of each boat should be considered as 100% and the other ones should be a percentage of that score per boat.
I have tried various codes but none seemed to work so far.

Any ideas? suggestions?
Thanks

EC
I'm thinking a subquery to select the max by team.
Jun 1 '07 #2
eliana82
3 New Member
I'm thinking a subquery to select the max by team.
how can i do that?
please help.
many thanks.
Jun 1 '07 #3
Rabbit
12,516 Recognized Expert Moderator MVP
It would be something like this:
Expand|Select|Wrap|Line Numbers
  1. SELECT x.Group, x.Member, x.Score,
  2.    (x.Score / (SELECT Max(Score)
  3.     FROM Table1
  4.     WHERE Group = x.Group)) As Percentage
  5. FROM Table1 As x;
  6.  
Jun 1 '07 #4
eliana82
3 New Member
HI,

I worked the SQL code and works fine in the subqueries.
I did subqueries per boat.
Now I have to link them together in another query but I can't seem to be doing it right.

I have the results of the 4 boats, which are the max of each boat with their percentages. I have created a query which integrates the boats separate subqueries but it gives me the percentages per query in different columns.
How can I integrate them into one column called lets say.. percentage?

Many thanks.

EC
Jun 4 '07 #5
Rabbit
12,516 Recognized Expert Moderator MVP
Use a union query.

But you should have been able to do everything in one query if the tables were designed correctly.
Jun 4 '07 #6

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

Similar topics

1
2510
by: Megan | last post by:
quick summary: i'm having problems trying to group fields in a report in order to calculate percentages. to calculate percentages, i'm comparing the results from my grouped fields to the totals. first, let me say that this is a really long post. i wasn't sure how much information/ background to provide, so i thought more was better than less. i tried to delineate certain areas so that it would be easy to peruse my posting and find...
3
6905
by: JDiamond | last post by:
Hi, I have a table called Hosts. The Hosts table contains the following fields: Each field represents a step in the project. The tech that completes each step initials the respective columns using a combo box within a form. These initials are stored in an engineer table in which the combo
26
2255
by: Mike Barnard | last post by:
Hi all. I am playing with html and css. I don't (yet) have a working site, I'm just trying to build a working, basic template I can use for a couple of ideas I have. I recall reading a discussion in a newsgroup in the past that came to the conclusion that the best way to use font sizes with css was to use percentages. Is that still the case? If so, how does one implement it?
5
9436
by: jonm4102 | last post by:
I'm trying to calculate the median of some numerical data. The data can only be found in a query (henceforth query 1) field I previously made, and I would prefer to calculate the median in a new query it without making a table out of query 1. I can't find a median function in the "Total" field, so is there so way to make an expression to calculate the median of the orignial data from query 1 in my new query? Also, what does name by...
5
2016
by: ye2127 | last post by:
Hi, I have two fields in my report. One of them is school name(the school name appears multiple times). The other field is class test score. How would I go about calculating the test average for each school? I can calculate the average of all the schools but am having difficulty coding some kind of sort procedure for an average test score of all the classes in each school. Thanks...
1
1518
by: ye2127 | last post by:
Hi, I have two fields in my report. One of them is school name(the school name appears multiple times). The other field is class test score. How would I go about calculating the test average for each school?(In a report) I can calculate the average of all the schools but am having difficulty coding some kind of sort procedure for an average test score of all the classes in each school. Does someone know the code for such a procedure?...
54
6637
namcintosh
by: namcintosh | last post by:
First of all, here is my program: #include <iostream> #include <conio> using namespace std; //Function prototype void getscore(int&, int&, int&, int&, int&); void findLowest (int, int, int, int, int, int); int main()
1
1815
by: Dineo | last post by:
Hi there I've created a database and a pivot table but I need to calculates percentages of all the WithdrwalAmt (the amount being withdrawn when retire) per PayeeName (where the money was invested after retirement, such as Investec) for each Scheme Name (Company name of the retiree). Please assist. Dineo
2
6373
by: ReneHernandez | last post by:
Good afternoon, I am trying to calculate an average over multiple fields. I've tried using the following =Avg(IIF( = "NA",Null, Val())) + Avg(IIF( = "NA",Null, Val())) + Avg(IIF( = "NA",Null, Val())) The above, , , etc. are text fields pertaining to an evaluation rating scale: NA 1 2 3 4 5
0
9629
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9470
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10298
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10127
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5500
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2865
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.