Temporary variable in Knime

Hello everyone !

I try to find a way to create cohorts. I succesfully classified my data within groups, yet I would like to classify it even more with sub groups.

Data is like this:
image
For each group, if Flag1+Flag2 > 0 then I would like to increment the subgroup by one. As it is shown below:
image

Feels like a temporary variable is a way to do so, something like:
t=1
For i in range 0,number of groups-1
IF Flag1+Flag2 > 0
THEN t=t+1
i=i+1
ELSE
i=i+1
END

but I didn’t quite get the implementation right within Knime…

Can you see what I am missing? Or another way to do so?

Thank you :slight_smile:

Hoi @Arthurgmu

Welcome to KNIME Forum. See this wf temp_vars_in_knime.knwf (19.5 KB).
image
gr. Hans

6 Likes

Hello @HansS

No loop, no variable and it works well on my side for what I am trying to do, thank you very much for your response !

See you :slight_smile:

2 Likes

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