hoon Posted March 27, 2010 Posted March 27, 2010 Hello all, Is there any way to loop find requests based on a value list? I essentially want to run a script based on multiple finds, but separately. If I have a field, FieldA where the in the values are 100, 100, 200, 200, 300, I'm looking for a way where I can loop a find request as a set variable so that the script would be like this. Set Variable[$var; Value:Table1::FieldA] Enter Find Mode Set Field [FieldA;$var] Perform Find Perform Script[script] However the "100" would loop so that then next find would search for "200" and so on. The long way would be to manually script out each value individually, but can a variable be used to loop this? Thanks in advance. Hoon
Søren Dyhr Posted March 27, 2010 Posted March 27, 2010 To the part of your question that makes sense to me ... Is there any way to loop find requests based on a value list? ...is the answer yes, it could be done this way, the variable is not required since the status function keeps track of the number of requests. --sd Requesting.zip
hoon Posted March 29, 2010 Author Posted March 29, 2010 Does this script search based on multiple find records or separate finds based on multiple records? I'll try to be clearer about my question and intent. I'm tracking a document that is split into separate parts like chapters. Within each chapter I'm also tracking individual records. Chapters are numerical such as 100, 200, 300, 400, etc. The number that I ultimately need to track is a combination of the chapter number and the record number, so that each database record has a unique ID of chapter-record number, i.e. 100-1, 100-2, 100-3, 200-1, 200-2, 200-3, etc. I have a script that will tell me what the max number is for each chapter so that if there are new records needed, I start with the next highest number. However, I need for that information to be copied into a separate field call max-number. Each max number will be different according to their respective chapters. I currently have a script that works but has to loop through each record and copy the info. I'm looking for a way to do a search by chapter first, then run the find max script, then loop to search by the next chapter and so on. I have a value list that is the field contents of the Chapter field. I hope this clears things up.
Søren Dyhr Posted March 30, 2010 Posted March 30, 2010 Not quite ...when dealing with databases, are there great benefits to gain from normalization and usually is it done by pulling the scenario thru a hand full normal forms nailing consistency issues... http://en.wikipedia.org/wiki/Database_normalization If you head down to "Objectives of normalization" ... are your data still packed or unpacked? --sd
hoon Posted March 30, 2010 Author Posted March 30, 2010 I think the data is unpacked. Thanks for the link. So records would be like this. |Chapter|record number|max number| |100|1|100-4| |100|2|100-4| |100|3|100-4| |100|4|100-4| |200|1|200-2| |200|2|200-2| |300|1|300-1| I'm looking for a way to update the max number whenever I add more records. So the next import might be Chapter 100, number 5. I would need the max number to all be updated to 100-5.
Søren Dyhr Posted March 31, 2010 Posted March 31, 2010 Right I wonder where the urge to script the matter originates from, is scaling issues pending? Perhaps it could be solved this way, sans scripting...please note that the first calc'field should have liftet the checkbox in "do not evaluate...." --sd hoon.zip
hoon Posted March 31, 2010 Author Posted March 31, 2010 That totally worked!! I hadn't thought about using relative tables at all. This is perfect since I was trying to modify things for scalability issues. Thanks for your help! Hoon
Recommended Posts
This topic is 5350 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