i dont know how i can do this.
I tried to use java snipet simple.
my code:
int isDigit;
string text;
text = $POSITIONSTEXT$;
if (text.matches("[0-9]+") && text.length() > 2) {
isDigit = 1;
}else {
isDigit = 0;
}
return isDigit;
but my code doesnt’ work. anybody have maybe a solution for java snipe simple and also for a simple rule based row filter?
Hi,
Use capital S for String:
String text;
P.S. Just as a hint: You have to set the return type to Integer.
ipazin
July 11, 2019, 9:56am
3
Hi there @Paddymaster ,
did you solve it?
You can use Rule-based Row Filter node but only is filtering is what you need obviously. Also length is something you should calculate prior to Rule-based Row Filter node. Additionally Column Expressions node is way to do it as well.
Br,
Ivan
1 Like
that was the mistake.
With the uppercase String i could do that.
@ipazin How can i do that with the rule-based row filter ? Can’t select only numbers
1 Like
ipazin
July 11, 2019, 12:31pm
5
Hi there,
you would like to check if a String contains only numbers and if so leave that row otherwise filter that row? If I haven’t understood you properly can you share a input data and desired output?
Br,
Ivan
1 Like
i upload a sample file.
In the solution i’ll check a column. If a value of the column is NULL or contains only numbers i will include these rows to the final table.
Testdigit.knwf (14.6 KB)
ipazin
July 16, 2019, 1:52pm
7
Hi,
tnx for workflow but you have reset checkbox clicked while exporting so no data can be seen…
Br,
Ivan
1 Like
testdigit.xlsx (8.1 KB)
now the xls is also online
3 Likes
ipazin
July 16, 2019, 2:01pm
9
Hi there!
This should do the trick in one node (Rule-based Row Filter). I guess
$Spalte4$ MATCHES "^[0-9]+$" OR MISSING $Spalte4$ => TRUE
Br,
Ivan
2 Likes
ipazin:
Spalte4
i add $Spalte4$ = “” to the rule-based row filter.
thats the solution:
thx
2 Likes
system
Closed
July 23, 2019, 3:12pm
11
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.