Newbies Paul49 Posted March 17, 2007 Newbies Posted March 17, 2007 I have a field that has 5 possible text values. How do I perform a count to see the total number of times each value appears in the db?
bcooney Posted March 17, 2007 Posted March 17, 2007 Create a calc flag field for each possibility: TextA_flag = if (patterncount ( myField; "TextA",1,0) then use a summary field to total each flag field.
Newbies Paul49 Posted March 17, 2007 Author Newbies Posted March 17, 2007 Thanks for the reply What u are saying is that for each value I want to count, I will have to create two new fileds?
bcooney Posted March 17, 2007 Posted March 17, 2007 Yes. Are you looking from one table to a child table for the counts? If so, you could use relationships to see all counts at once.
Newbies Paul49 Posted March 17, 2007 Author Newbies Posted March 17, 2007 It's all in one table. The main table contains bio data of people...names, dob, address, race, employment, etc. I would like to be able to count the number of each race among other counts.
bcooney Posted March 17, 2007 Posted March 17, 2007 (edited) This topic may help, it uses relationships to calculate the counts. This is much better than summary fields, since you can see these counts without running a report. See this post I also need to say that matching on data and not on an ID is not a good idea. For example, if you change the value list from "TextValue" to "TextValue2," it will not update pre-existing values and so your counts will not be 100% accurate. However, if the user was really entering ID=2 then you could change the TextValue that shows for ID=2 and the value stored is still ID=2 and your counts will be 100% accurate. I guess that's just a long-winded way of saying, "match on ids and not on text..or live to regret it!" Edited March 18, 2007 by Guest added speech about id matches, lol
Recommended Posts
This topic is 6522 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