I would like to filter a column, which contains 5 values: 1, 2, 3, 4, 5 multiple times. This column is part of a data sheet.
I attempt to do these steps in a loop:
- filter a pattern from 1 to 5
- count the rows which contains the sepecific value
- rename count column (spec name) for e.g. one, two, tree, four, five
- table row to variable
Sending email once containing the statistics.
Where can I put a loop node? What type of looping node can solve this issue?
Thank you very much for your help!
I don’t think you need a loop structure. You can use the Value Counter node to count the occurrences of the values in a specific column.
I need to do these stpes more times in case of other type of variables.
e g. data1, data2, data3…and I need these special name as a variable.
Thank you so much for your help.
welcome to KNIME Community!
You mean you need loop cause column names might change or? Can you share some (dummy) input data and desired email output to avoid guessing what you need
So in the meantime my questin has been changed, because I found another way to solve this iteration issue.
I have a data.xlsx table with important_event column.
I would like to send a statistics per email about the sum of important_event type.
My question is:
How can I refer a variable if it does not exist in the table?
I would like to refer to the 4th type assign to a 0 value in the email html file.
Is there any solution?
data.xlsx (8.8 KB)
I would like to add the original issue, because the last one, which I mentined yesterday, does not seem to be solvable.
So the original question is:
How can I count and save these sums in diferent variables, when I have e.g. 5 types of itemes in a column.
These wf contains repeted steps:
- row filter
- value counter
- column rename
- table row to variable
Originally I would like to find a looping solution for this part.
Thank you very much!
This would be an option, but I am interested in an easier, smarter solution:
Instead of a RowFilter you can use a GroupLoop. See this workflow looping_problem.knwf (29.6 KB)
Your solution proposal is a quite perfect, thank you very much.
It works well, if the column contains all of the 5 types, but if it does not, I will only have the variables, which types are in the column currently.
My goal is to have always all the five variables refering to the five types, hence I would like to refer them constantly in the email (html).
Thank you so much again!
In that case, I added a table with all possible values, that is used to check if they are available in the dataset. See looping_problem.knwf (68.2 KB)
Thank you for the fast help. Your last suggestion works well.
don’t like it but seems like table with all possible values and then join is needed in this case (anyone with idea how to improve it?) but why not doing a full outer join and then use Pivoting node?
looping_problem_ipazin.knwf (86.9 KB)
tsja, much more efficient @ipazin +1
Pivoting is a much easier solution, I also like this workflow.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.