向 KNIME 中的行添加 NULL 值

Adding NULL value to row in KNIME

有谁知道是否可以在 KNIME 中向行添加空值?

我正在尝试使用规则引擎删除一些值,并将它们替换为 NULL。

此致

no syntax(从 KNIME 3.4.0 开始)用于声明规则引擎节点中的缺失值。不过有一些解决方法:

  1. 当您指定哪个个案应具有非缺失值时,非匹配行 will be missing

    If no rule matches, the outcome is a missing value.

  2. 您可以拥有一个包含所有缺失值且类型正确的列,并将该列设置为结果,例如 ... => $missingIntCol$

随着Rule Engine (Dictionary) node the outcome column cannot contain missing values.)

首先使用规则引擎创建一个虚拟空列,然后使用另一个规则引擎来编写您需要的内容 例如。 $Example Column$ = "#" =>$Dummy Null" 这将用 Null Values

替换 Example Column 中的#

希望对您有所帮助

Column Expressions 节点中有 missingValue() 函数,其中 returns 单元格中缺少值。列表达式节点基于 JavaScript 语法,因此可以采用以下逻辑:

if(column("column1")=="someValue") //create missing
{ 
    missingValue()
} 
else //take value from colum1
{ 
    column("column1")
}

可以正常使用'Java Snippet': 通过下方菜单创建输入输出。如果您为输出列选择 'replace' 选项,您可以直接替换输入值。否则你已经创建了一个新列。

这里是要粘贴和编辑的示例 java 代码:

if(c_your_input>100)
{
    out_your_input = c_your_input;
}

如果没有匹配 with if 子句,则自动创建缺失值。