carsarecoffins Posted May 26, 2004 Posted May 26, 2004 I have a Work Orders file that contains an order_no field and rev_no field. I want to find the number of numbers in the order_no field. For example, I could have: order_no 1234 rev_no 01 order_no 1234 rev_no 02 order_no 1234 rev_no 03 order_no 5678 rev_no 01 order_no 4321 rev_no 01 order_no 4321 rev_no 02 and I would want the result to be 3. So what I want to know is the number of groups of the same number. Sorry if this is confusing but I didn't know quite how to ask the question.
Oldfogey Posted May 26, 2004 Posted May 26, 2004 I hope you are prepared to play. Set up a valuelist based on the field order_no. The valuelist will remove duplicates. Then set your output field Num_of_Num to ValueListItems(filename, yourvaluelist).
-Queue- Posted May 26, 2004 Posted May 26, 2004 I think Paul means PatternCount( ValueListItems(filename, "yourvaluelist"), "
carsarecoffins Posted May 26, 2004 Author Posted May 26, 2004 I get the idea behind making a value list and counting the number of items in it, but I can't get it to work. I have attached a file showing how I set it up maybe you can tell me what I'm doing wrong. num_of_num Test.zip
-Queue- Posted May 26, 2004 Posted May 26, 2004 Change "num_of_num Test" to "num_of_num Test.fp5" or Status(CurrentFileName) and change the calculation to be unstored by selecting 'Do not store calculation results' in the storage options.
carsarecoffins Posted May 26, 2004 Author Posted May 26, 2004 Thanks! It can be awful dark where my head is sometimes.
-Queue- Posted May 26, 2004 Posted May 26, 2004 Adding fp5 isn't necessarily intuitive, especially if your OS is set to not display extensions. It took me a while to figure out the problem, too. I'm surprised it returned any value at all since the reference wasn't acceptable! There should be some sort of error returned instead. I prefer the Status(CurrentFileName) though, since it's much more dynamic and doesn't require tweaking if you happen to change the file name. Cue the dancing hot dog banana:
carsarecoffins Posted May 26, 2004 Author Posted May 26, 2004 I agree about the Status(CurrentFileName) method, much more stupid resistant. Now I am trying to figure out how to make this calc work with only a found set.
-Queue- Posted May 26, 2004 Posted May 26, 2004 Add a relationship from a global text field to order_no and base the value list on the related order_no. Then use the Copy All Records trick to get the order_nos for the current found set into the global field. Check the attachment for how it works. Do a find, then run the first script. Note that you can 'hide' the global field or put it on a separate layout and change the script to go to that layout before the Paste, then return to the original layout. num_of_num Test.zip
Oldfogey Posted May 27, 2004 Posted May 27, 2004 If there's anything I hate it's people 'correcting' my posts - especially when the correction is correct.
Recommended Posts
This topic is 7855 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