Hello,
I want to replace the missing values in column ‘FC5%’ with the formula :
FC5% = FC5/MHR*100
I want this formula to apply only to the missing values and not to all values in column FC5%.
MV.xlsx (8 KB)
Thanks
Br
Hello,
I want to replace the missing values in column ‘FC5%’ with the formula :
FC5% = FC5/MHR*100
I want this formula to apply only to the missing values and not to all values in column FC5%.
MV.xlsx (8 KB)
Thanks
Br
Try this.
Thanks
Can we handle multiple columns in the same node with ‘column expression’ ?
Br
Yes. Just be aware that a limitation of the Column Expression node is that you cannot use your newly created columns in a later calculation inside the same node.
For example if I make a column called C that is column A*B you cannot create column D that uses column C in its calculation.
Here’s the original workflow with several additional operations. The output is pointless, but it illustrates how the structure works. Note the B column illustrates the problem I previously noted. You’ll need a downstream node to manipulate any new or revised columns.
That is generally true, but there is a workaround for some use cases allowing a column to “remember” the previous value written for that same column.
@takbb I have enormous respect for your expertise. Your contributions have helped the Knime community immensely. I would respectfully submit that sometimes elegant solutions are harder for “average” Knimers to use than a simpler brute force approach which also works.
Hi @rfeigel , thank you for the kind words. Your contributions to the community are valued too, and I agree with you that some solutions aren’t always appropriate and they are not always for everybody.
Having multiple ways to achieve a goal is a good thing, and if people are able to choose the option that feels right for them, or is more easily understood then all the better. I don’t seek to suggest a “right way” or even a “better way”, but simply “another way”.
I continue from the same example. The missing values (numbers) are now completed with Column Expressions. I would like to continue and complete the missing values in the Quality column (string), and as in the first case, I only want to fill in the missing values. If I use the ‘Rule Engine,’ the entire column will be changed. Is there another solution?
Math Formula + Missing Values.knwf (83.5 KB)
Thanks
Br
Try this. You’ve got to loop over individual rows. You can remove the iteration column if you don’t need it,
Hello,
The issue is that if I use this solution, I will replace all the data in the “quality” column. What I want is to replace only the “missing values”.
Math Formula + Missing Values 2.knwf (86.9 KB)
Thanks
Br
I don’t understand. Your original file has no “quality” column. There’s nothing to replace.
Hello
This is the file with the quality column
MV.xlsx (8.1 KB)
Math Formula + Missing Values 2.knwf (86.9 KB)
I look for to replace missing value only in the quality column.
Thnaks
Br
You’re still not clear. The original file has no quality column. My workflow creates a % cell for each missing one than it uses your rules to create a quality column for each %. What’s the issue?
Ok let me clarify. Here is the complete file.
MV.xlsx (8.1 KB)
Firstly, you mentioned a formula to only fill in the Missing Values with “Column expression” in the FC5% column.
The “Quality” column (string) depends on the FC5% column and roughly follows the rules I’ve outlined in the “rule engine”. Unfortunately, this is an approximate rule. What I want is for this rule in the “Rule Engine” to only fill in the missing values of “Quality”. The values already present in this column (Excellent, Good, etc.) are correct, so I want to keep them as they are.
Tanks
Br
Would have been nice if you’d posted the correct file the first time. I’ll take a look at it.
This should work. Asking for help on the Forum is a two way street. You need to assume that potential helpers know nothing about your issue. You need to post the correct data and a clear, detailed explanation of your problem.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.