Jump to content

conditional increment in import


ronbob
 Share

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

Recommended Posts

i need to import records from one file (A) to another empty file (:. The file A contains compant records with orders. what i need to do is to have conditional increment whereby the increment occures only if the company number is different. all records for company id ? will have the same record id incremented.

i need the increment to be done only if the company id is different on imports.

can any help with this?

thanks

Link to comment
Share on other sites

in imports the script could be

increment on record 1

if company id is equal to previous record copy the increment value from previous record.

elseif next record has a different company id then increment by 1.

in a loop evaluate all records.

can any one help with this?

thanks

Link to comment
Share on other sites

You need to steps in this process:

- import all the records you need, just as they are

- then loop through the imported found set and apply your logic in a loop script.

store the "company ID" and "recordID" in a global, then go to the next record and check their companyID against the global.

If they are the same, change the record ID of that record to the one in the global

If they are not the same, update the 2 globals to the values of the companyID and recordID of the current record

Link to comment
Share on other sites

This topic is 5756 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
 Share

×
×
  • Create New...

Important Information

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