Hi all,
I am trying to get top 5% of a product rate column. How do I achieve this using KNIME?
Thanks in advance.
M
Hi all,
I am trying to get top 5% of a product rate column. How do I achieve this using KNIME?
Thanks in advance.
M
Hi @X24 & welcome to the KNIME community.
For this task, you could either use the -Sampling- node or the -Partitioning- node.
Hope it helps.
Best
Ael
hi @aworker,
Thank you for your reply. I have a case where top 5% of 8 is just 0.4. And partitioning node is throwing an error saying that the count > 0. But I still want that row to be included. How do I solve this?
Thank you.
Hi @X24
Sorry I’m not in front of a computer. You would need in this case to calculate beforehand as an integer variable how much is 5% of your total number of rows (upper integer value) and then use this variable to set the option of absolute number of rows in one of these sampling nodes.
Hope it helps.
Best
Ael
Hi @aworker,
Thank you for your quick reply.
So, I have created a calculated integer variable as shown below:
Now, I have to assign the Test column values to a Sampling node and get those top values from a table.
How can I assign the values to a sampling node and also get the for ex: Top 8 values for Amber from another dataset?
Thanks in advance.
M
Hi @X24
After reading your last post, I have the impression I misunderstood your initial question but from the latter, I believe the solution you need is a bit more involved and as follows:
20220309 Pikairos Get top 5 percent of a column.knwf (79.2 KB)
The workflow is commented node by node. I hope it is clear enough and “2) Result” answers your question. Otherwise please get in touch.
Hope it helps.
Ael
I would use the top k filter for this.
Hi @Iris
I just had a look at the node you mentioned and I wonder whether it really fits @X24 need. Maybe @X24 will tell us ?
Anyway, I didn’t know of this node, so many great nodes available in KNIME
Thanks @Iris !
Best Ael
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.