Read multiple tabs from an Excel sheet - how to add tab name so that I can (row) filter?

Hey friends,

I have the results from a process simulation in an Excel file with multiple tabs (attached) and can load them into KNIME following these instructions: Knime 4.5.1 how to read all sheet in excel - #6 .

However, it now lists all records in one table and I like to do different calculations where I need different infos from one or more tabs. My question now is how I can add the tab name to the results table, so that I can do a simple row filter and have only the content of one tab in a table.

In the past, I did these calculations by using different Excel readers that pointed to the same file but different tabs, but that is inconvenient for a user. It would be better to just ask them to select one file, and it would then split this into multiple tables (and then apply the calculations from there).

Does this make sense for you?

Thanks in advance,
Roland

Simulation statistics without risks copy.xlsx (2.8 MB)

first:

an Excel file is called a workbook. and what you call “tabs” are actually worksheets. just adding this to reduce future confusion.

second:

in more or less all cases of input or configuration fields, you have the option to use an existing variable (Flow Variable) or to create a new one by providing a name for it. In the modern UI typically, those flow variables can be accessed by hovering over the config field or by right-clicking the node (at least the last time I used the modern UI, i am still sticking with the now legacy UI).

in the legacy UI, you have a separate tab for flow variables to manage within each node.

the variable itself can then be used e.g. with a constant value node to be added to the table.

1 Like

I’m not entirely sure I understand what you want. Try this. It allows the user to select one or more worksheets from a multiple worksheet workbook.

2 Likes

Hey,

Thanks for the prompt reply. Let me give you a bit more (business) background:

I am working in the BPM space, and one of the interesting things—besides process mining—from a data perspective is to do simulation. There are tools out there that will give you spreadsheets like the above, but they are not very user-friendly.
My idea is to take common metrics (some here: Simulation metrics - Google Docs) and calculate them in a KNIME workflow so that the users don’t have to “hunt for themselves,” but things are standardized and easy to use.

The final objective is to create a scenario comparison like the one shown in the graphic below or show the metrics in a dashboard, but for now a simple spreadsheet as the result of the KNIME magic is fine.

My current state is that I take the XLS and read each tab separately and also collect all metrics manually, but this is inconvenient.

The idea for v2 (and my question above) is to have only one XLS to be connected and then filter by source tab information so that I keep the current calculations but avoid having to select the same file over and over and make mistakes when selecting the sheet in the Excel Reader dialog.

Going on forward I’d like to automate the second part as well, but that is a bridge that I will cross when I get there :slight_smile:

I will take a look at your example, and maybe that solves my v2 state with some modifications :wink:

oh, damn, I made a mistake in v3 - it should say “Read one file” of course …

Hey @rfeigel,

This worked for my v2 (just select all in the widget)!

I greatly appreciate your help :slight_smile:

1 Like

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