Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Ok to clarify:

NO - I do not want to export the found set from my source file.

1) I find a set of records that match my criteria and sort.

2) I run a script which writes data into global fields within the source database, this script will stop at a certain record within the found set when it has gathered enough data

3) At this point I want the global fields of the source database written into a single record of the target database.

4) The script continues and repeats its process, writing relevant data into the global fields, until it is ready to write the data to the target again. The loop ends when the found set is exhausted.

Posted

Ok to clarify:

NO - I do not want to export the found set from my source file.

1) I find a set of records that match my criteria and sort.

2) I run a script which writes data into global fields within the source database, this script will stop at a certain record within the found set when it has gathered enough data

3) At this point I want the global fields of the source database written into a single record of the target database.

4) The script continues and repeats its process, writing relevant data into the global fields, until it is ready to write the data to the target again. The loop ends when the found set is exhausted.

Posted

OK. It is not entirely clear why you have to concatenate the data into the global fields.

If this is data from the found set - or part of the found set - it might be easier:

1. Find a set of records that match your criteria and sort.

2. Mark the found set, if needed.

3. Go to record n + 1 (n = number of records with "enough data").

4. Omit multiple (the rest of the found set).

5. "Export" the reduced found set - i.e. call Import script in the target file.

If this is not acceptable, and you absolutely need to export many-to-one (concatenate n records in source to 1 record in target), then:

1. In target file, create a number field Registered.

2. In source file, create a calc field cCreator = 0.5

3. Create a relationship NewTarget from source to target:

cCreator = Registered (enable creation of records).

When you have your global fields ready, call a script:

Set Field [NewTarget::field1 , globalfield1]

Set Field [NewTarget::field2 , globalfield2]

...

Set Field [NewTarget::Registered , 1]

Exit Record/Request

Posted

OK. It is not entirely clear why you have to concatenate the data into the global fields.

If this is data from the found set - or part of the found set - it might be easier:

1. Find a set of records that match your criteria and sort.

2. Mark the found set, if needed.

3. Go to record n + 1 (n = number of records with "enough data").

4. Omit multiple (the rest of the found set).

5. "Export" the reduced found set - i.e. call Import script in the target file.

If this is not acceptable, and you absolutely need to export many-to-one (concatenate n records in source to 1 record in target), then:

1. In target file, create a number field Registered.

2. In source file, create a calc field cCreator = 0.5

3. Create a relationship NewTarget from source to target:

cCreator = Registered (enable creation of records).

When you have your global fields ready, call a script:

Set Field [NewTarget::field1 , globalfield1]

Set Field [NewTarget::field2 , globalfield2]

...

Set Field [NewTarget::Registered , 1]

Exit Record/Request

Posted

Seems like the approach I'd take, if I'm understanding correctly, is this:

Assuming you have a table with prescription variable items, and a table for the students:

1. Create an indexed calc field in the items table, recNumAsTxt = getAsText(Get(RecordNumber))

2. Create a relationship items2::recNumAsTxt = students::scripItems (using a duplicate occurrence of the items table). If you want 30 randomly selected prescription items per student record for one time use, then the scripItems field will be an indexed calculation [text] =

GetAsText ( Round ( Random * [number of items minus one] ; 0 ) ) &

This topic is 7188 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.