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

Optimizing the use of CASE Statements

Hello,

I'm currently working on a project with Talend where I need to extract data from a file. I'm using a tFileInputDelimited component followed by a tJavaFlex component. One of the pieces of data contains a numeric code ranging from 1 to 100. Depending on this code, it should correspond to a specific string.

Creating 100 individual CASE blocks to handle the different cases seems impractical and not very efficient.

I'm seeking suggestions to optimize this process. Has anyone encountered a similar situation before? Are there best practices or alternative approaches that can be used to handle a large number of cases more efficiently?

Thank you.

Labels (4)
2 Replies
Anonymous
Not applicable

Hi

Take a look at tReplaceList component, maybe you can create a mapping file and use this component to replace of case statement block.

 

Regards

Shong

Anonymous
Not applicable

How about creating a CSV file something like:

 

ID;String Value

 

then use tMap and join this with the main dataflow of yours.

 

Later it's enough to handle the CSV file outside of the job.