In the “Import from Excel” transformation the sheet can be specified using a parameter. Create a project (A) that imports one particular sheet which name is defined by a parameter.
Then there is “Spreadsheet metadata” transformation (button “Insert table” -> category “File”) – it extracts all sheet names from a spreadsheet into a list. Create another project (B) with this transformation and get a list of 36 sheet names. Then use “Iterate” transformation on this list to run project A for each sheet name.
Files and screenshots were are updated with correct ones. As @michel.baldellon noticed, in the original ones there was a mistake – sheet name was hardcoded instead of using a parameter.
i thought it is similar question. I have lists of 10 csv files with 50 rows each. I have created one csv file and transform it to show only the last row. I imported the 10 list of files. When I iterate with the transformed file expecting to show me only the last row of each file (10), instead I get all rows of 500. Where do I mess up or what do I miss? Eyasu
please create new topics for your questions. To create a new topic just press “+New Topic” button in the upper right corner of the home page. Iterations is a big subject. Your question, while related to iterations, is not related to the subject of this topic which is consolidating sheets of a spreadsheet, not multiple csv files. I will answer it here, but next time please create a new topic, instead of posting into existing ones. This would also make it easier for other people to find relevant answers.
If you’re expecting to see only the last row in each file, then the iterated project should return only 1 last row for file, not entire file. For this, you can use the “Trim table” transformation to keep only 1 row at the bottom. If you have multiple tables in the iterated project, make sure that in the “Iterate” transformation you’re indicating the table with 1 last row as the returned result, not some other table.
you’re totally correct – I uploaded wrong version of the example, with sheet name hardcoded in the iterated subproject. It should use a parameter, of course. I’ve updated the files and screenshot in the original comment.
I’m not sure to fully understand what you have changed between the 2 versions…
If I use your new files, it’s OK.
But if I want do replicate that from scratch… I fail and I load each time the first sheet!
Like if the parameter was “harcoded”…
In the child project (Load One Sheet) the sheet name should be specified using the only parameter of that project (“Sheet name”). Because the parameter is assigned by the parent project (Load All Sheets) in iterations, it makes the child project to read every time another sheet.
My mistake was that the sheet name wasn’t defined using the parameter. It was always the same name, therefore in every iteration it read the same sheet.
I know it’s been a long time since this was active, but following last comment from Michael Baldellon, an option could be to add function to load info from list of files, like it is for importing excel spreadsheets.