Using Multi Variable Loop action to be generate multiples files

More
2 years 3 months ago - 2 years 3 months ago #23566 by prashant
Purpose : - Generate a filtered file for each salesman which is emailed to him/her.

Brainstorming
1. I am thinking using new loop action in package, I should be able to pass variable into a transformation where I could technically pass this onto a validation but how do I even run this transformation ?
 2. How to generate customised file name based on column name?

Input 1 - List of Salesman with UniqueSales Code
 

Input 2 - List of all sales done by them 
 

Output 1 - Expected - Filtered CSV containing relevant data for sales person 
 

All the CSVs are attached in the files (seriously allow us to upload csv)  

File Attachment:

File Name: Archive_20...4-05.zip
File Size:10 KB

 
Last edit: 2 years 3 months ago by prashant.

Please Log in or Create an account to join the conversation.

More
2 years 3 months ago #23576 by prashant

Please Log in or Create an account to join the conversation.

More
2 years 3 months ago #23577 by Peter.Jonson
Let assume that you have a sales file with 10 million rows and 10,000 customers lookup file

Loop reads list of customers file and passes customer id to the transformation

Transformation reads 10 million rows from sales file and filters it by customer id and creates the file

So the entire loop will read 10 million rows 10,000 times

That will take a lot of time and processing power

The better and faster option is to use a single transformation

The default repository has an example 0016 (every example has a number)

It does exactly what you want



 

Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

More
2 years 3 months ago #23578 by prashant

Let assume that you have a sales file with 10 million rows and 10,000 customers lookup file
Loop reads list of customers file and passes customer id to the transformation
Transformation reads 10 million rows from sales file and filters it by customer id and creates the file
So the entire loop will read 10 million rows 10,000 times
That will take a lot of time and processing power
  • This is a bit of extreme example , my files are not more than 100,000 rows. Although I would love it if my sales team can generate 1million rows for a year  
  • But God Forbid I have a scenario that I have 10 million rows & 10,000 customer lookup files , I will absolutely prefer automation and tonnes of processing power to do this than load this 1 by 1 with 0016. Worst case I will do this at midnight via scheduler.
  • But just for reference purpose , I dowloaded a 5m record file with 173 unique customers (cities). On OSX , in another program which I am sure is highly optimised takes around 1 min 40 sec  See boring countdown 
  • 5 Million CSV file was downloaded from HERE

Please Log in or Create an account to join the conversation.

More
2 years 3 months ago #23579 by Peter.Jonson
>>>I will absolutely prefer automation and tonnes of processing power to do this than load this 1 by 1 with 0016.

It is is probably all my fault because I am not explaining it correctly.

0016 is the fastest option, It does everything in one go, without loop  and not one by one
 

Peter Jonson
ETL Developer
The following user(s) said Thank You: prashant

Please Log in or Create an account to join the conversation.

More
2 years 3 months ago #23581 by prashant
HI Peter,
Thank you for the last post , it's much clear now
  • Can you explain the mechanics of this calculations below
Code:
begin   if GetVariable('<file_name>')<>[F001] then //  record chaged   begin     SetVariable('<file_name>',[F001]);     SourceChanged; // creating new file   end;   Result:='test'; end;
  • Can I also assume this will work for CSV to CSV output as well? This is csv to xls

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save