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

Alternatives to creating multiple case blocks

Hello,

I'm currently working on extracting data from a file using a tJavaFlex. I use the substring method a lot. But now I need to use cases. In fact, I'm extracting a string from the file that can correspond to more than 100 categories. I can create a hundred cases in my tJavaFlex, but that makes the code harder to read. So is there a more efficient way to do this in Talend?

Thank you !

Labels (3)
1 Reply
Anonymous
Not applicable

Hello @Stéphane Barbezier​ ,

To avoid multiple switch case statements in java, you can use HashMap as instead.

Please refer to this:

https://stackoverflow.com/questions/64692014/how-to-avoid-multiple-switch-case-statements

 

Best regards

Aiming