Hello everybody, I want to see if someone can help tell me with a certain problem (or lead me in the right direction), as I am having a terrible time with coming up with the proper solution.
Okay, let’s say that I have a document LIST like the below (which took me almost 3 hours to figure out), which contains date and number information (completely sorted).
sortedDocumentList (name of list)
Of course, the above list could be different. Above is just an example, but let’s say today I received the data above and the only rule is:
If the date is the same, then you need to map the date and lownum to its own document, then after you’re done, map contents involving the next unique date to the next document. When I’m completely done, then all documents should be ftp’d to the customer.
This means that based on the above, there are TWO documents involved. 0-2 are supposed to be mapped to fields in Document A and 3 is supposed to be mapped to fields in Document B. This is because the dates are the same in sortedDocumentList 0-2 and 3 is different, which requires mapping to its own document.
I’m just not figuring out at the moment the best strategy to accomplish this. Below idea doesn’t seem right, plus whereas today I’m writing to TWO documents, tomorrow, I could need to write to 10 different documents. It all depends on how many unique dates I get and that varies.
LOOP over sourceDocumentList
Map Date to VAR
LOOP over sortedDocumentList2 (which I copied from sourceDocumentList)
If Date from sortedDocumentList2 = Date from sortedDocumentList
Write to fields in Doc A
Write to Doc B (however today there could just be 2 doc, whereas tomorrow there could be 10 – depends on unique dates)
PLEASE HELP! Can you point me in the right direction?