Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Check if a value in a string variable is numeric

Hello,
How can i check if a Value in a string variable in numeric (integer or real).
Thanks for help
Andreas
Labels (2)
5 Replies
Anonymous
Not applicable
Author

You can use regular expression to validate the string as integer or real.
Vaibhav
Anonymous
Not applicable
Author

Hi Vaibhav,
thanks. But im not good in coding Java. Please do you have some code for me.
Andreas
Anonymous
Not applicable
Author

hi,
java parttern 'shortcut' for that :

\d  : A digit:
\D  :  A non-digit:

you can use a tFilterRow tocheck with contains or matches method.
https://help.talend.com/search/all?query=tFilterRow&content-lang=en
https://stackoverflow.com/questions/15130309/how-to-use-regex-in-string-contains-method-in-java
regards
laurent
Anonymous
Not applicable
Author

sorry but i dont know how i use this in a tjavarow.
Anonymous
Not applicable
Author

use tFilterRow. By that way you can have a flow with data matching pattern & reject flow (data doesn't).
see link above to documentation & example from Talend help.
ps : remember that you have shortcut 'F1' to get help for every component directly from your Talend Studio.
regards
laurent