OL Learn

Nested tables in CSV. Wrong content

I,ve got a CSV file with 3 levels of data:

CITIES ( 1…N)
- City ( alfa )
CUSTOMERS OF CURRENT CITY (1…N)
- Customer ( alfa )
INOICES OF CURRENT CUSTOMER (1…)
- InvoiceID (alfa )
- Amount ( num )

Sample Data:
///////////////////////////////////////////////////////////////
City;Customer;InvoiceID;Amount
BCN;CL1;F11111;23424
BCN;CL1;F222;124124
BCN;CL1;F333;23525
BCN;CL1;F452535;52335
BCN;CL1;F5;52355
BCN;CL2;F343;35235
BCN;CL2;F3235;88
BCN;CL2;F23552;52
BCN;CL2;Fg5fg;632
BCN;CL2;F63gg;5235
BCN;CL3;F3463;5235
BCN;CL3;F46v gg;23525
TAR;CL889;F0933;556
GIR;CL53;Fdgdr56;673
GIR;CL53;Fbdr54;04
GIR;CL54;F634634;6234
GIR;CL54;F346346;234
GIR;CL54;F34646;2352
GIR;CL54;F34646;744
///////////////////////////////////////////////////////////////

I Set the boundaries to “ON CHANGE” field City, that’s ok.

Then a loop “until no more elements” to read the customers of the current city. Store in a table CUST_LIST that’s is ok

Inside this loop, another loop “While statement is true” comparing the current customer field with the previous one. In this loop I read the invoice fields InvoiceID, Amount into the table INV_LIST

The goto step is inside the second loop

The first Customer of each record ( CITY ) is ok, but the next ones get mixed values in the “InvoiceID” and “Amount” fields from the first one and the current one. The number of records is ok however

Its look like the INV_LIST table is not initialized on create a new entry
I guess that the problem must be on the goto field.

Any clue?

What did you do to have only three customer and not twelve? Did you do some script in your data selection for customer extraction?

I have reproduce the behaviour, although my Datamapper is slightly different than yours. I will escalate this to our R&D and get back to you with the answer.

Our R&D confirms the issue. They also mention that it it a UI issue and that the resulting output does show the proper values.

To follow up on this issue, please refer to issue SHARED-74790.

Sorry for the delay.
I didn’t use any script, ( although I tried ;- ) ) just the modules that you can see.

Great Hamelj.
Good to know . I wass assuming that it was my fault and didn’t chect the output.
Waiting for news, there’s not rush.

Just for knowing, do you have any way of doing this via scripting?
Thanks

There is unfortunately no workaround, but as @hamelj already mentioned, the problem only occurs while you are designing your data mapping configuration. But if you save your configuration and test it from the Workflow tool, you’ll get the proper results.

It’s a bit of a pain in the butt having to send your DM config to Workflow in order to ensure that it works correctly, but at least it does work.

No problem.
Thanks for the support

They way I did it via scripting was as follow:

  1. I extract the City
  2. I add an Action in which I simply define a variable named customerCode (without the keyword var, so it is global) which I set to empty
  3. I loop Until no more element
  4. Inside the loop: I setup a condition that compare the content of the column Customer with the content of the variable customerCode
    4.1 If they are different, I extract the Customer which ends-up in the detail table customer
    4.2 If they are different, I set the variable customerCode with the current value for the column Customer
  5. I extract the InvoiceID and the Amount and manually enter the name of a nested table after the customer one (as shown in the attached image) and call it other
  6. I setup the Goto

Hi Hamelj. Good solution. That’s the way I was looking for initially
Thanks