# How to retrieve the filename into a column using a File Iterator with the Excel Query

**URL:** <https://matillioncommunity.discourse.group/t/how-to-retrieve-the-filename-into-a-column-using-a-file-iterator-with-the-excel-query/1777>\
**Category:** Matillion ETL\
**Created:** [June 10, 2022, 12:38pm UTC](https://matillioncommunity.discourse.group/t/how-to-retrieve-the-filename-into-a-column-using-a-file-iterator-with-the-excel-query/1777 "2022-06-10T12:38:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lightbody](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/lightbody/32/37_2.png) [@Lightbody](https://matillioncommunity.discourse.group/u/Lightbody)\
**Post date:** [June 10, 2022, 12:38pm UTC](https://matillioncommunity.discourse.group/t/how-to-retrieve-the-filename-into-a-column-using-a-file-iterator-with-the-excel-query/1777/1 "2022-06-10T12:38:03Z")

</div>

I have a GCP Storage bucket with a bunch of files in the following format.

Open Sales Orders DP (F4211) 10 June 2022 07\_16\_14

&nbsp;

I want the file iterator to run through all the files (which works) but I need to retrieve the date from the end of the filename. I added a variable ${filename} and set the default as the above, but when i add that to the data selection box for the excel source, it just says "Unrecognised options:" Open Sales Orders DP (F4211) 10 June 2022 07\_16\_14

&nbsp;

I don't understand how this is meant to work, and the instructions aren't clear enough.

&nbsp;

Thanks for any tips or guidance that might help me move forward.

---

<div class="post-metadata">

**Author:** ![ganesh\_pitchai](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@ganesh\_pitchai](https://matillioncommunity.discourse.group/u/ganesh_pitchai)\
**Post date:** [August 26, 2022, 5:42pm UTC](https://matillioncommunity.discourse.group/t/how-to-retrieve-the-filename-into-a-column-using-a-file-iterator-with-the-excel-query/1777/2 "2022-08-26T17:42:22Z")

</div>

Hi

&nbsp;

I know space not an issue with your case, Can you try change the mode to advanced and try to write a select statement?

&nbsp;

or

&nbsp;

Put quotes in your filename parameter in storage url properties

&nbsp;

If you fixed already please share the solution.

---

<div class="post-metadata">

**Author:** ![Lightbody](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/lightbody/32/37_2.png) [@Lightbody](https://matillioncommunity.discourse.group/u/Lightbody)\
**Post date:** [September 9, 2022, 2:07pm UTC](https://matillioncommunity.discourse.group/t/how-to-retrieve-the-filename-into-a-column-using-a-file-iterator-with-the-excel-query/1777/3 "2022-09-09T14:07:40Z")

</div>

Answering my own question. The key is to use a file iterator component with an orchestration job, then within that component do the Excel Query step, and whatever else you need to do, with the filename which will be held in the variable.
