Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Amit4
Contributor III
Contributor III

If length = 10 then pass to Valid table otherwise pass record to Invalid table

Hi,

I have tDbinput to get data from input table. Then I am using tmap to push the Data to Valid and Invalid tables.

I have one Key column which length should be 10 and it should be integer. If it contains any character it should go to invalid table. 

 

Flow:  input--->tmap-->validation(length 10 & all integers) - if true - > Valid table

                                                                                                 else -->Invalid table

 

Amit4_0-1717155687707.png

 

Thanks in Advance!

Amit

Labels (3)
3 Replies
Shicong_Hong
Support
Support

Hello 

Add a filter condition for the validate output table, set the condition as:

row1.columnName.length()==10&&Mathematical.NUM(row1.columnName)==1

Add a filter condition for invalidate output table, set the condition as:

!(row1.columnName.length()==10&&Mathematical.NUM(row1.columnName)==1)

 

Regards

Shicong

Amit4
Contributor III
Contributor III
Author

Hi Shicong,

Thanks for your response but when I am putting length function in tMap. I am getting this error.

Type mismatch cannot convert from Boolean to String.

Amit4_0-1717177738151.png

FYI: The column on which I am applying that is String data type.

Thanks

Shicong_Hong
Support
Support

Write the Java code in the filter expression field.

Shicong_Hong_0-1717381828473.png