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: 
prabuj
Contributor III
Contributor III

if row1 is zero, then return as 1 else return row1

Hi Team,

Please help out on this logic.

For ex: I have three columns A, B, C ----- all the three columns are string data type.

If C is 0 , then I want it as 1 , else C as it is. From this output,

I want to add the C column numbers , based on the A column ID's and return a output as D column.

0695b00000IcSIaAAN.png

Thanks & Regards,

Prabuj

Labels (3)
3 Replies
XJ_1630
Contributor III
Contributor III

 

your question seems to be asking for a very simple Java solution.

Please confirm.

 

your pseudo-solution could as:

 

tFileInput -(row1)-> tMap -(row2)-> tFileOut

 

 

 

in tMap, you define your 'Column_C' as:

 

row1.Column_C == "0" ? "1" : row1.Column_C

 

i hope it helps

prabuj
Contributor III
Contributor III
Author

@Xuan Junior​ error,

Please find the screenshot below

 

0695b00000IcdJ0AAJ.pngHelp out to solve. thanks in advance.

 

XJ_1630
Contributor III
Contributor III

@Prabhakaran Rajendran​ 

 

i will teach you to fish, instead of, giving you a single fish ..

 

Talend is a code generator

 

the Graphical Job is used to create JAVA CLASSES (and other objects)

thus, your error refers to a COMPILE ERROR in the java class created by Talend based on your job.

 

to verify, the code created by Talend -> click on: CODE

in the lower left coner of the Job

 

the CODE editor will highlight errors with a RED DASH on the right of the editor:

 

 

 

this makes easier to find any existing problems

 

your error is a very basic Java error - just research a little and learn more Java

this is the best advice at this point.

 

Good Luck