Hi everyone,
I am new to KNIME and I have tried everything for the following:
How to create a new excel file based on the country. The new file will have each country name on new worksheet and contain data only related from that country. For example sheet1-“Canada” will have 5 entries from Canada, sheet2- “USA” will have 4 entries and so on.
Thank you
Thank you for the solution, I tried it workflow. I was using end instead of variable loop. However, this workflow great on table but not for excel file, I tried it but it did not worked, I have uploaded mine workflow and excel file as well. Book1.xlsx (9.0 KB) Excel sheet loop.knwf (1.8 KB)
Hi @SatwinderGill , the workflow you uploaded was empty, so I’ll have to guess at what your problem is when using an excel file as you don’t actually tell us what error you are seeing.
My suspicion is that you ran the workflow supplied by @ActionAndi and then replaced the Table Creator with your spreadsheet. On running again, it then failed because the worksheet already existed.
If that was the problem, simply edit the Excel Writer so that where it says “fail” if sheet exists, you set it to “overwrite” i.e. on the line in @ActionAndi 's earlier screenshot that I have marked with the red boxes.
I have created this on community hub the work flow.
I did changed the file name but the problem I am facing is the output excel file creates only one country sheet for Example “Canada” and all the data from Canada. The loop work only once, I can’t make the loop iterate again to create other sheet. I used append write to excel file option every time I execute this workflow with new excel file name.
For some additional background on how to find out what is going on… when your Group Loop Start node has the red (x) on it, you can hover your mouse over that to get an idea of why it has failed.
The Group Loop Start node requires that the items that you are grouping by all appear together in contiguous groups. If they are not, you either need to sort them prior to the Group Loop Start (e.g. using a Row Sorter) or else as already mentioned, you need to configure the Group Loop Start node to do the sorting for you.
Configuring the Group Loop Start node, you’ll find the option under “Advanced Settings”. I have no idea why that is considered “advanced” since it appears to be fairly fundamental to the correct operation, but anyway that’s where it is!