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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

instruction while in Talend

hi guys,
i'm a newby and i'm a problem with the instruction while in tMap in Talend (java)
i've setted the variables:
a ------>new Integer(row1.x)*1000
b ------>new Integer(row1.y)*1000
c ------>new Date(new Long(Var.a)).getDay()
d -----> 0
then i've setted the column:
while (Var.a<Var.b)
{
Var.a=Var.a+86400000;
if (new Boolean(Var.c<6 && Var.c>0)) Var.d=Var.d+28800000;
}
where is the problem(s)?
Labels (3)
11 Replies
Anonymous
Not applicable
Author

i don't manage the instrution while, if, for, etc. there is a documentation where i can find the explanation of their use?... in java not in perl, thanks in advance.
Anonymous
Not applicable
Author

Hi
In tMap, you can use the column expression like this: Var.a<Var.b?myValue1:myValue2
Best regards
shong
Anonymous
Not applicable
Author

Hi
In tMap, you can use the column expression like this: Var.a<Var.b?myValue1:myValue2
Best regards
shong

ok, in fact is the only expression that is right but if i want use it in a "while" or "for" expression for example:
while (Var.a<Var.b)
{
Var.a=Var.a+86400000;
if (Var.c!=0) Var.d=Var.d+28800000;
}
i must use "if" because the expression with ? it give error (misplaced construct) and also with "if" it give the same error... where i'm wrong?
p.s.: all Var are int
Anonymous
Not applicable
Author

so, none has ever used the "while" or "for" expression (java) in Talend? what is the correct syntax?
amaumont
Contributor III
Contributor III

Use a routine and code your while into, then call this routine from tMap.
Anonymous
Not applicable
Author

Use a routine and code your while into, then call this routine from tMap.

a routine?
please where can i find information about how to use a routine?
amaumont
Contributor III
Contributor III

You can download the documentation, and find near page 12, in topic Repository > Codes > Routines a short description of this functionality.
You will be able to create new (static) methods in a class and call it from tMap. Take example on System routines if you wish to use in tRowGenerator or other components which need to read parameters from routines.
I created a feature issue 3114 to document more precisely this subject.
You can also see this post http://talendforge.org/forum/viewtopic.php?id=2159.
Anonymous
Not applicable
Author

Use a routine and code your while into, then call this routine from tMap.

thanks, it works
Anonymous
Not applicable
Author

are there someone who find a solution to use while instruction in tmap talend ????