Jump to content

This topic is 7585 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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).

Posted

I think Paul means PatternCount( ValueListItems(filename, "yourvaluelist"), "

Posted

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.

Posted

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:

yay.gif

Posted

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

This topic is 7585 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.