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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error in tmap expression syntax

HI all,

Can any one please suggest me on below expression in tmap component.

Scenario: I am trying to filter the records in tmap component using below expression, but unfortunately i am getting expression syntax error.

row.EMPNO==7839

error message: Exception in thread "main" java.lang.Error: Unresolved compilation problem: 

please suggest me on the above error.

 

thanks,

Hareesh

Labels (3)
5 Replies
TRF
Champion II
Champion II

Hi,

 

You miss the row number in the expression "row.EMPNO==7839".

Should be "rowX" where "X" depends on your job design.

 

In case you just forgot "X" in the post, is EMPNO an integer?

Then if it's a String, replace the expression by the following if it makes sense:

"7839".equals(rowX.EMPNO)

or this one to convert EMPNO before the evaluation:

Integer.parseInt(rowX.EMPNO) == 7839

Hope this helps.

Anonymous
Not applicable
Author

HI,

 

thanks for your input.

i tried with below approach but it didn't work.

In case you just forgot "X" in the post, is EMPNO an integer?--- Yes I forgot the X

  is EMPNO an integer??--- No EMPNO is BigDecimal

tried the below expressions both:

 Integer.ParseInt(row1.EMPNO)==7839...it didn't work

 could you please look into it.

TRF
Champion II
Champion II

So, transform you 7839 to a BigDecimal before the camparison:

BigInteger.valueOf(7839).compareTo(row1.EMPNO)

Should work.

Anonymous
Not applicable
Author

Hi ,

 

I tried with below given expression but it was giving an error BigInteger cannot be resolved.

 

So i tired using tConvertType component to convert my BigDecimal to Integer then filtered it. so it is working now.

please do let me know do you any documented related to all converstion types???

thanks.

TRF
Champion II
Champion II

You're right.

You need to import java.math.BigInteger first. 

Google should help you to learn all about datatype conversion.

Don't forget to close the case for other people facing the same issue.

Kudos also accepted for the given time.