Reputation: 81
I have a simple clients table in sql server that contains 2 columns - client name and city. In Azure Data Factory, how can I export this table to multiple csv files that each file will contain only a list of clients from the same city, which will be the name of the file
I already tried, and succeeded, to split it to different files using lookup and foreach, but the data remains unfiltered by the city
any ideas anyone?
Upvotes: 1
Views: 2579
Reputation: 4925
You would need to follow the below flow chart:
@activity('LookUp').output.value
a) Copy activity
i) Source : Dynamic Query Select * from t1 where city=@item().CityThis should generate separate files for each country as needed
Result: I have 2 different Entities, so 2 files are generated.
Input :
Output:
Upvotes: 2
Reputation: 16401
You can use Data Flow to achieve that easily.
I made an example for you. I create a table as source, export this table to multiple csv files that each file will contain only a list of clients from the same city, which will be the name of the file.
Data Flow Sink settings: File name options: as data in column and use auto mapping.
Check the output files and data in it:
HTH.
Upvotes: 3