I am currently trying to split a table into multiple tables. The tables are to be split according to calendar weeks, i.e. a table is to be created for each calendar week and so on. I know that Row Splitter or Rule Based Row Splitter can be used for this, however both of these nodes only have 2 output ports, so I need to build a lot of such nodes into my workflow to make this possible. I am sure there is a simple method in KNIME to ensure this. My table to be split looks something like this:
Note: There are not just the three calendar weeks, the table contains many more weeks. For this reason, I would like to know how the table can be divided by calendar weeks.
I would be very thankful if someone here in the forum could help me out.
do you want to perform the same kind of transformation on each subset or write each subset?
In this case, I would recommend to build a loop using the Group Loop Start node.
Hi @hm1995 , if you want to have/see different tables to separate the weeks - 1 table per week for example, I don’t think there is any other way than using multiple nodes such as Row Splitter or Rule-Based Row Splitter.
However, if the purpose of separating the data per week is to process them, then you can process them via loops, and that’s what @Kathrin suggested.
For example, if it’s to write them to different files - 1 file per week for example, this can be done via a loop.
Can you elaborate why do you need to split the data per week, like what happens next? What kind of operation/transformation do you after?
Hi @bruno29a/ @Kathrin,
thank you for your reply. The main reason for splitting the data is to visualize Top 10 Hashtags (Coloumn: Term as String) for each calender week as Tag Cloud or Bar Chart, so basically those splitted tables/data are used for further process. Now I’m trying to create a Table file (Table Writer) for each subset, but I don’t know whether it is the right thing to do for visualisation as I have to import those tables back again in my workflow. So far I have added those additional nodes according to Kathrin’s answer and my grouped table for the first calender week looks like this at the moment
I would be very thankful if you can give me further suggestions.
Hi @hm1995 , if it’s just for visualization, you can use the Table View node.
You can have your top 10 per year+week all in the same 1 table (so 10 records per year+week), and then plug the Table View at the end. The Table View allows interactions where you can filter per Year, etc.
If you can provide some sample data, I can put something together quickly to demonstrate this.
thank you so much for your help. Here some data, which you can use
Sample_Data.xlsx (16.9 KB)
Thanks for the sample data @hm1995 . I am assuming that the ranking of the hastags is basically doing on the Count columns, in descending order.
I put something together that looks like this:
To use the interactive view, just use this option from the Table View:
And the Interactive view looks like this:
You can Filter by typing the year-week in the Search field.
Here’s the workflow:
Top 10 hashtags display using table view.knwf (32.3 KB)
Thank you so much, so far it worked perfectly. How can I visualise the searched week from the table view. Is there any possibility that my search is saved, so that I can create a diagram based on my query
Yes, so if you have other things to do after this point, you can simply select the records from the result of the searched week. For example:
Just click that box, and it will select everything on the screen.
Just click Apply and Close.
You can check the results of the Table View now. Check the
So, you can add a Row Filter after the table view and filter only those that were chosen/selected.
And you get only the records that were selected:
You can generate diagrams or graphs based on that after, or export to a sheet, etc.
Thank you so much Works perfectly
No problem @hm1995 , my pleasure
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.