Help, to read sheets with loop

please help, I try to read the sheets in one excel with the loop, I think everything is setted well but the result is unexpected. and how to upload my workflow for your inspection?

the problem is the variable for sheet name didn’t work.

Hello @Tigerfox
Welcome to KNIME community.
It would be good to see your workflow. You can upload it by selecting this icon located above the message you are writing


Happy KNIMEing

1 Like

Hi @Tigerfox , as @Kazimierz indicated, it is easier to offer help with what is almost certainly a configuration option, if you can either upload the workflow, or show us your configuration. Otherwise there is a lot more guesswork involved.

I can say though, that a common mistake here is to not include all of the required configuration. Usually people forget/don’t realise that even though they have identified the use of “sheet” as the flow variable:

it is also necessary to configure the Excel Reader to ensure it is actually using the sheet name.

i.e. Select sheet “by name”. The default is “first sheet”, in which case sheet name flow variable will be ignored.

I would guess that one or other of the above steps have been missed.

In the past there have been some issues noted with setting sheet by flow variable. See

Although for me, sheet selection by name appears to work, AP-18133 does appear as a fix in the changelog for the upcoming KNIME 5.3 release, so if it’s still not working for you, the workaround mentioned by @mlauber71 in the above post, is probably the way to go.

6 Likes

thank you, yes.I know the button to upload but I don’t know which files should I upload for the workflow. I open my local files and there are a lot of folders…

Hi, I checked, think nothing was wrong. actually I pettery sure the problem is from “Excel reader” this node. but I can’t find the problem, your point I checked is right, still, can’t work.
please find my screen cutting.






sales.xlsx (11.3 KB)

First of all @Tigerfox you need to export your workload: right-click the workflow name, select Export KNIME Workflow, and select the location to store the workflow.
Then, upload save file to the Forum.

Hi Kazimierz, thank you so much!! so easy, please forgive that I’m a newer who just jumped in…would you mind checking my workflow as attached?
NONGFU.knwf (82.0 KB)

NONGFU.knwf (82.0 KB)
And here is my workflow, thank you !

OK @Tigerfox your workflow works properly. It means it doesn’t generate any errors, variable ‘Sheet’ is available, and the result is:
image

Then the question is: what is expected result?

I might be no available for the rest of the day (at my time zone), so please feel free to stay in touch with other KNIMErs or get in touch the other day.

Hi @tigerfox,

there are a couple of things.

One is that it would be better to have the Excel Reader also use the path of the file being read by the Excel Sheet Reader, rather than manually specified. Whilst in this case it will still work, if you ever changed the Excel Sheet Reader to use a different file, you might forget to change it in the Excel Reader, leading to unexpected issues:

Secondly, your config is still set to Select Sheet based on “First with data” rather than “By Name”. You have to change this as mentioned earlier, either by setting it manually in the Excel Reader node, or by using a flow variable as described in the link I posted before.

A further issue is that your spreadsheet does not have column titles in the two sheets you are wanting to read, and is currently using row 1 (which is a data row) as column headings. You need to turn that off in Excel Reader to get the results you need:

(@Kazimierz , unfortunately although it looks ok, it isn’t working correctly since as per the screenshot you posted, it is currently picking up data from the first sheet rather than the named sheet)

4 Likes

@takbb Hi thank you, sincerely, it works now.
yes in the first reply you piont out the “select sheet” with “by name”.but I missunderstand your wording before, :rofl: it’s my problem :joy:, thank you again!!!

1 Like

thank you! it works now, I need set the “select sheet” with by name, otherwise the variable will be ignore.

1 Like

and also thank you for your advice for using path as variable to reader excel, I see the meaning when I continue to move forward, and also the colum names is helpful!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.