<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Filtering files using a SQL view or table in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4918375#M8982</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to retrieve several historical csv files from a on-premise folder.&lt;/P&gt;&lt;P&gt;The name of each file mainly has a prefix, a middle string and a final date, in yyyymmdd format, plus the csv extension.&lt;/P&gt;&lt;P&gt;F.e. the name of a file could be sourceprefixfile_middlestring_20251231.csv.&lt;/P&gt;&lt;P&gt;In the remote folder there are a file for each day:&amp;nbsp;sourceprefixfile_middlestring_20251201.csv,&amp;nbsp;sourceprefixfile_middlestring_20251202.csv,&amp;nbsp;sourceprefixfile_middlestring_20251203.csv and so on; but I need to get the end of month file as&amp;nbsp;sourceprefixfile_middlestring_20251031.csv,&amp;nbsp;sourceprefixfile_middlestring_20251130.csv,&amp;nbsp;sourceprefixfile_middlestring_20251231.csv, etc and not all files.&lt;/P&gt;&lt;P&gt;So, I've implemented a SQL view in a warehouse to obtain the end of month files respect to each source prefix file starting from 2022-01-01. This view exposes the source prefix file and the month end date (in yyyymmdd format).&lt;BR /&gt;Then, I've tried to filter all files by the SQL view using a pipeline: I've implemented a lookup activity to read the SQL view, then a get metadata activity to get all file name (childitems), but I'd like to match the corresponding output arrays possibly without reading all files more times. I cannot implement an exact match, I can filter a file respect to the source prefix file and the month end date, returned by the lookup activity and not to an exact name.&lt;/P&gt;&lt;P&gt;Then I should use a for each activity to iterate the filtered files in order to copy them in a lakehouse.&lt;/P&gt;&lt;P&gt;Now, any suggests to me to implement the right filter condition for the filter activity? Many thanks&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jan 2026 21:28:24 GMT</pubDate>
    <dc:creator>pmscorca</dc:creator>
    <dc:date>2026-01-14T21:28:24Z</dc:date>
    <item>
      <title>Filtering files using a SQL view or table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4918375#M8982</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to retrieve several historical csv files from a on-premise folder.&lt;/P&gt;&lt;P&gt;The name of each file mainly has a prefix, a middle string and a final date, in yyyymmdd format, plus the csv extension.&lt;/P&gt;&lt;P&gt;F.e. the name of a file could be sourceprefixfile_middlestring_20251231.csv.&lt;/P&gt;&lt;P&gt;In the remote folder there are a file for each day:&amp;nbsp;sourceprefixfile_middlestring_20251201.csv,&amp;nbsp;sourceprefixfile_middlestring_20251202.csv,&amp;nbsp;sourceprefixfile_middlestring_20251203.csv and so on; but I need to get the end of month file as&amp;nbsp;sourceprefixfile_middlestring_20251031.csv,&amp;nbsp;sourceprefixfile_middlestring_20251130.csv,&amp;nbsp;sourceprefixfile_middlestring_20251231.csv, etc and not all files.&lt;/P&gt;&lt;P&gt;So, I've implemented a SQL view in a warehouse to obtain the end of month files respect to each source prefix file starting from 2022-01-01. This view exposes the source prefix file and the month end date (in yyyymmdd format).&lt;BR /&gt;Then, I've tried to filter all files by the SQL view using a pipeline: I've implemented a lookup activity to read the SQL view, then a get metadata activity to get all file name (childitems), but I'd like to match the corresponding output arrays possibly without reading all files more times. I cannot implement an exact match, I can filter a file respect to the source prefix file and the month end date, returned by the lookup activity and not to an exact name.&lt;/P&gt;&lt;P&gt;Then I should use a for each activity to iterate the filtered files in order to copy them in a lakehouse.&lt;/P&gt;&lt;P&gt;Now, any suggests to me to implement the right filter condition for the filter activity? Many thanks&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2026 21:28:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4918375#M8982</guid>
      <dc:creator>pmscorca</dc:creator>
      <dc:date>2026-01-14T21:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering files using a SQL view or table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4918530#M8984</link>
      <description>&lt;P&gt;you already have everything that you need in the lookup.&amp;nbsp;The simplest approach would be:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Lookup gets rows: (prefix, month_end_yyyymmdd)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Get-metadata gets all filenames (childItems)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Filter activity keeps only files where:&lt;BR /&gt;filename startswith(prefix) AND filename contains(month_end)&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In Fabric pipelines the filter condition looks like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159377" data-lia-user-login="And" class="lia-mention lia-mention-user"&gt;And&lt;/a&gt;(&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;startswith(item().name, item().prefix),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;contains(item().name, item().month_end_yyyymmdd)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If your lookup returns an array of objects, wrap the filter under a ForEach on the lookup output, but do NOT do multiple Get Metadata calls:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;1 Get Metadata&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;1 ForEach over lookup records&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Inside: Filter on the &lt;EM&gt;same&lt;/EM&gt; childItems list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This prevents repeated enumeration of the folder. You generate a single list of files and apply logical filtering per prefix/date combination.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2026 08:32:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4918530#M8984</guid>
      <dc:creator>Vinodh247</dc:creator>
      <dc:date>2026-01-15T08:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering files using a SQL view or table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4918838#M8986</link>
      <description>&lt;P&gt;&amp;nbsp;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="719515" data-lia-user-login="pmscorca" class="lia-mention lia-mention-user"&gt;pmscorca&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are a few additional best practices and enhancements you can consider to make your pipeline more reliable, maintainable, and scalable when filtering and copying historical end-of-month CSV files from on-prem folders using a SQL view + Data Pipeline approach in Microsoft Fabric:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make Filtering Case-Insensitive (If Needed) --&amp;nbsp;If filenames might have inconsistent casing (e.g.,SourcePrefix_20240131.csv)&lt;/P&gt;&lt;P&gt;Trim Extra Whitespace in Lookup Output-- To&amp;nbsp;ensure the prefix and month_end columns are trimmed to prevent false negatives&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post helps, then please appreciate giving a Kudos or accepting as a Solution to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2026 17:55:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4918838#M8986</guid>
      <dc:creator>ssrithar</dc:creator>
      <dc:date>2026-01-15T17:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering files using a SQL view or table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4918839#M8987</link>
      <description>&lt;P&gt;Hi, thanks for your reply.&lt;/P&gt;&lt;P&gt;I'm implementing this solution:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Lookup activity to read the SQL view in warehouse, getting some rows with some columns (source prefix file and month end date);&lt;/LI&gt;&lt;LI&gt;Get metadata activity to access to on-premise folder with csv files and to get the child items;&lt;/LI&gt;&lt;LI&gt;For each activity to iterate respect to lookup output --&amp;gt; @activity('Lookup').output.value;&lt;BR /&gt;inside the For each setting two variables to save source prefix file and month end date for the current item;&lt;/LI&gt;&lt;LI&gt;Filter activity to filter the output child items returned from the Get metadata activity.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The filter condition used is:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159377" data-lia-user-login="And" class="lia-mention lia-mention-user"&gt;And&lt;/a&gt;(
startswith(item().name, variables('SourcePrefixFile')),
contains(item().name, variables('MonthEndDate'))
)&lt;/LI-CODE&gt;&lt;P&gt;I think that the For each should be sequential.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2026 18:02:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4918839#M8987</guid>
      <dc:creator>pmscorca</dc:creator>
      <dc:date>2026-01-15T18:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering files using a SQL view or table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4920861#M9003</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="719515" data-lia-user-login="pmscorca" class="lia-mention lia-mention-user"&gt;pmscorca&lt;/a&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Following up to confirm if the earlier responses addressed your query. If not, please share your questions and we’ll assist further.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2026 13:12:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4920861#M9003</guid>
      <dc:creator>v-aatheeque</dc:creator>
      <dc:date>2026-01-19T13:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering files using a SQL view or table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4922030#M9019</link>
      <description>&lt;P&gt;Ok, about this issue&amp;nbsp;I think that the For each should be sequential, isn't it?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 17:26:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4922030#M9019</guid>
      <dc:creator>pmscorca</dc:creator>
      <dc:date>2026-01-20T17:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering files using a SQL view or table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4923081#M9027</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="719515" data-lia-user-login="pmscorca" class="lia-mention lia-mention-user"&gt;pmscorca&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Yes, ForEach is the right approach here. You will use ForEach to loop through each SQL row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank You.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jan 2026 05:46:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4923081#M9027</guid>
      <dc:creator>v-aatheeque</dc:creator>
      <dc:date>2026-01-22T05:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering files using a SQL view or table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4930027#M9045</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="719515" data-lia-user-login="pmscorca" class="lia-mention lia-mention-user"&gt;pmscorca&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;We wanted to follow up to check if you’ve had an opportunity to review the previous responses. If you require further assistance, please don’t hesitate to let us know.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jan 2026 11:23:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Filtering-files-using-a-SQL-view-or-table/m-p/4930027#M9045</guid>
      <dc:creator>v-aatheeque</dc:creator>
      <dc:date>2026-01-27T11:23:02Z</dc:date>
    </item>
  </channel>
</rss>

