Using greater than and less than symbols with a widget

Hello,
Is there a way to use a widget to input a greater than > or greater than or equal to >= (or any operator) and use it in the workflow? I have a set of standards (KPIs) I’m trying to use against accounting data and need to be able to input numbers like >=4. I have tried to input these operators as a string, but they are unusable in computations.

Thanks,
Ryan

hi,
what about using the number and then do the filtering/splitting/…transformation based on the number input converted into flow variable? e.g. keep rows great or equal to Flow variable (your widget input)
Does that not work for you in your current context?
br

I can do that, but these standards change from contract to contract and I would have to change my workflow each time an operator changed (i.e. from >4 to <6). It would be helpful if I was able to input all the standards in the contract on each run through of the workflow. I’m trying to compare and contrast different contract standards to show, as an example, Meantime to Equipment Failure and how that effects cost (i.e. <=95.9% uptime/per period).

Hi @rangerry

You can make this work pretty quickly. Below is a simple draft.

Use two configs: one to select the column where the filtering should be applied to and one which contains the rule that you want to apply.

image

With a variable expression node, I’m drafting the final rule:
join("$",variable("column-selection"),"$ ",variable("rule")," => TRUE")
In this case I’m taking the syntax of a Rule-Based Row Filter. Connect it to the row filter node below.

In the row filter, insert a random simple rule that works (this will be overridden later).

Navigate to the Flow Variables section and apply the rule.

image

Stick it in a component and you will be able to apply any desired rule. Starting point:

image

Some results:

Hope this helps!

3 Likes

Wow…that was amazingly detailed and I believe you hit the nail on the head! This should work for my issue. Thank you very much.

Awesome! If it works out for you please mark the post as Solution. This also helps fellow KNIME users who have similar questions to find solutions quicker :wink:

2 Likes

From the seem of things, it looks like joining the KNIME forum has worked out to be a good decision for you @rangerry! :wink:

Nice solution @ArjenEX !

Yes it has! Thanks again @takbb

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.