Applying loops in EasyMorph

Example_Files.zip (70.7 KB)

I am trying to learn how to use loops in EasyMorph. To achieve this, I tried to set up a EasyMorph project in which a simple for loop is used. I also tried look for different sources that explain how this works but it still is not clear to me. Could you please help me with the following application?

*I have 10 base files that each contain 250k rows. These files are called 'Base_file01.xlsx' to 'Base_file10.xlsx'. For sake of ease, I narrowed the amount of rows per Base_file down to 10 rows. Each Base_File contains the following columns: *
1. Article Number
2. Supplier
3. Gross price
4. Discountfactor
5. Net price

*I also have four different customers that each obtain their own unique discount. These customers are called customers A, B, C and D. The discount each customer receives can be found in a different file called 'discounts.xlsx'. Each discount per supplier per customer is listed in a column (Discountfactor Customer A, Discountfactor Customer B, and so forth). *

*For each customer, I would like to use the 10 Base_files, add the discount from 'discounts.xlsx' file via the merge from another table' command to generate the 10 unique lists for each customer. *

For example: for customer A, the discount needs to be added from 'Base_file01.xlsx' to 'Base_file10.xlsx' via the 'merge from another table' action. Then, the files 'CustomerA_file01.xlsx' to 'Customer_file10.xlsx' need to be generated by using the for loop. For customer B, C and D a similar approach will be used. Pllease explain how I can use a for-loop to loop over these 10 base files in EasyMorph in such a way I that I can use the 'merge from another table' action in each iteration to generate the unique lists for each customer. So, the output for customer A should be 'CustomerA_file01.xlsx' to 'Customer_file10.xlsx', each containing the 10 products of each corresponding Base_file.

Your time and attention are greatly appreciated.

Kind regards,

Pricelist

Hi,

I would do it like this:
pricelist.zip (73.1 KB)

Kind regards,

Jochen

1 Like

I appreciate your reply, thank you.

I do have one additional question.

Suppose due limitations of the ordering system on the side of customer A; the customer is only willing to accept a list of a maximum of 10 products. I two files (Supplier_File_01 and Supplier_File_01) that contain the following suppliers.

  1. Beat Blueprint in Supplier_File_01.
  2. Peak Designs in Supplier_File_01.
  3. Zenith Creations in Supplier_File_02.

The list for customer A should contain 3 products of Beat Blue, 2 products of Peak Designs and 5 products of Zenith Creations.

It does not matter which products are selected, so selection could possible occur at random but this does not have to the case.

How can the above be achieved?

Kind regards,

Pricelist.
Supplier_File_01.xlsx (10.9 KB)
Supplier_File_02.xlsx (9.1 KB)