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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tMap error Exception in thread "main" java.lang.Error: Unresolved comp

Hello
I have the following error when i run some code in the expression builder of tMap
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
this is my code, can anyone help?
while (StringHandling.LEN("row2.id") != Var.MaxLen)
{
row2.updatedID ="0" + row2.id ;
}

row2.id=string
var.MaxLen=int
row2.updatedId=string
Ashley
Labels (3)
6 Replies
Anonymous
Not applicable
Author

Hi
Try this expression in the expression field of column:
StringHandling.LEN(row2.id)==Var.MaxLen?row2.id:"0"+row2.id
Best regards
Shong
Anonymous
Not applicable
Author

thank you for your reply Shong
can you be clear where to use this?
Anonymous
Not applicable
Author

just realised that my code doesnt make sense.
it should be
(i am trying to make ids all with the same length)
row2.updatedID=row2.id;
while (StringHandling.LEN("row2.updatedId") < Var.MaxLen)
{
row2.updatedId ="0" + row2.updatedId ;
}


however i am still having errors
Anonymous
Not applicable
Author

got it working!
many thanks
Anonymous
Not applicable
Author

when i am trying to remove ? symbol from my data which is bigdecimal i am getting this exception
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
can you please tell me hoe to remove that symbol in tmap
Anonymous
Not applicable
Author

when i am trying to remove ? symbol from my data which is bigdecimal i am getting this exception
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
can you please tell me hoe to remove that symbol in tmap

Can you please show us your expression? If you want to achieve some if...else statement in tMap, you have to use the following expression format:
condition?value if true: value if false
Best regards
Shong