ash00182 Posted July 20, 2006 Posted July 20, 2006 hi guys i posed this question a few weeks ago now if i do a find and this comes up with 10 results and i have a field called result which shows different number values ie, 1, 3, 4, 1, 12, 9, 3, 2, 15, 1, how can i get to count all the 1's in this case the answer should be 3, i had a couple of replies, but nothing that worked fully what i need to no is if this is possible or should i rethink my data base grateful for any advice thank you
Genx Posted July 20, 2006 Posted July 20, 2006 a) Change it to a number field instead of a text field Search for =1 or if that doesn't work ==1 I forget which is which, look up operators when your in find mode (or just go to help and open the help manaul and search operators)
LaRetta Posted July 20, 2006 Posted July 20, 2006 I missed that you had responded on the original thread you started on this subject - I have been too busy to keep up on forums or even respond anyway. And now you are starting at ground-zero again which takes everyone's time to try to re-figure out what you need - from the beginning. If it 'didn't work fully' you need to explain what you tried and what didn't work. For those who wish to help, the other post is: here . All you need is a grouped report. I explained it in quite some detail. I don't have time right now to put together a demo - maybe someone else can. But a simple grouped report is something you can do ... heck, the Report Assistant walks you through it. :wink2:
ash00182 Posted July 20, 2006 Author Posted July 20, 2006 hi laretta tried your suggestion and what i mean by sort of works is this the stotalcount works fine ie 10 find results and it says 10 but the field only reports what is in the high lighted field ie find one, the field says 4, result says 4 i need it to count all the number ones in the 10 seperate find results your suggestion says value = which is what i need but it doesnt get there hope your not working yourself to hard
rellis32 Posted July 21, 2006 Posted July 21, 2006 Couldn't a Relationship based on the number field work for this situation? Or even the number field related to a constant set to 1? Then by using the calculation Count ( relation::numfield ) it would give the total of related records, the only downside to this is, you need to be on a record that displays "1" in order to see a total of the ones. Heres an example. CountNum.zip
LaRetta Posted July 21, 2006 Posted July 21, 2006 i need it to count all the number ones in the 10 seperate find results Why? If there is only ONE field, a report will group and count them properly (if sorted on the number field). Just find all your records (not one number at a time). If you have 10 'like' fields then you are in trouble and I suggest you split them into records in proper relational structure or you will forever be dealing with problems (reporting just being one). I cannot say this strongly enough. To count 10 separate fields, you will need 10 table occurrences but that is only a Band Aide covering a much deeper problem. LaRetta
ash00182 Posted July 21, 2006 Author Posted July 21, 2006 imagine a runner in a race ( 10 or more races ) he finishes in different positions ie 1, 2, 3, 4,1, etc these are my results. i am trying to count the 1's in order to calculate the runners winning percentage thats the why, but like you i am begining to think i need seperate result fields
LaRetta Posted July 21, 2006 Posted July 21, 2006 Yes, each runner for each race should be a separate record with only one field containing his finish location. I see now which direction you went - 10 races, right?
ash00182 Posted July 22, 2006 Author Posted July 22, 2006 yep 10 races, do you think its possible to get the percentage wins 10 races = 10 diferent records , (10 different results) all in the result field. or should i start again with the results all in seperate fields
LaRetta Posted July 22, 2006 Posted July 22, 2006 Oh you can do it. You would need a calculation (number) for each race position, ie, cFirstPlace = ( Race1 = 1 ) + ( Race2 = 1 ) + ( Race3 = 1 ) + ( Race4 = 1 ) + ( Race5 = 1 ) ... and so on But you will want more stats (percentages amongst racers) and you will again face the same problems. Split them into records now while you can. What happens when you add race 11? You will 1) have to change every calculation xor add another relationship? YUK!! Fields in the new RaceResults table would be: RunnerID, RaceID and FinishPosition. Then your reporting will be a piece of pie. LaRetta
ash00182 Posted August 2, 2006 Author Posted August 2, 2006 sorry ive been awhile replying been on holiday took your advice tho and all the percentages now work now i have another problem where by after doing a find the page keeps refreshing all the results drop down one after another and when it gets to the last result it starts loading from the top again this can keep going for several minutes and then stops until i do a new find then it starts again any ideas, i thought it maybe a calculation updating but if so how do i stop it
Recommended Posts
This topic is 6688 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now