Tutorial Gateway

  • C
  • C#
  • Python
  • SQL
  • Java
  • JS
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs
  • MySQL

Talend tLoop

Talend tLoop is the same as For Loop or While loop. Use this Talend tLoop component to execute another component or job for a given number of times. This section covers multiple examples of the Talend tLoop to help you understand it completely.

Talend tLoop Example

Drag and drop the Talend tLoop component to the job designer window.

Talend tLoop 1

As you can see from the tLoop below, it has For loop and While loop options. Please choose as per your requirements, and for now, we kept it as For loop. Next, it has From, To, and Steps options with default values. It is same as for(i = 1; i <= 10; i++) or for(i = 1; i <= 10; i+1)

Talend tLoop 2

To display the iteration values, we used the tJava component.

Talend tLoop 3

Within the Talend tJava, we add the Java println statements to print the current loop value in the iteration.

System.out.print(((Integer)globalMap.get("tLoop_1_CURRENT_VALUE")));
System.out.print("\t Ieration No = " + ((Integer)globalMap.get("tLoop_1_CURRENT_VALUE")));
System.out.println();
Talend tLoop 4

Let me run this Talend tLoop job and see the output. As you can see, iteration started at one and ended at 10 with an increment of 1.

Talend tLoop 5

This time, we used the tRowGenerator to generate random rows for each iteration. For this, first, we changed the For loop maximum or to value to 5.

Talend tLoop 6

Within the tRowGenerator editor, we added four different columns. Next, we changed the number of rows to 2 that will generate two random rows.

Talend tLoop 7

Next, we added the tLogRow to display the result. In general, the tRowGenerator has to generate two rows and four columns. However, we used the tLoop to iterate the tRowGenerator. It means for each loop iteration, tRowGenerator has to generate two random rows. So, the total records will be five iterations * 2 random rows = 10.

Talend tLoop 8

You can see the tLoop output.

Talend while Loop 9

To make this interesting, we added one more row whose value is the tLoop current value. Use Control + Space to get the suggestions.

Talend while Loop 10

Next, we changed the to value to 3 to accommodate all the results in the single screenshot.

Talend for Loop 11

Now, you can see two randomly generated rows for each iteration.

Talend for Loop 12

Filed Under: Talend

  • Talend Download and Install
  • Create a Talend Business Model
  • Create a Talend Job
  • Create a Global Context Group
  • Connect Talend to SQL Server
  • Context Group to connect DB
  • Talend Read Text File
  • Talend Read Excel File
  • Load Text File Data into Database
  • Load Excel Data into Database
  • Export Database Table to Excel
  • Export Database Table to TextFile
  • Export Database Table to XML
  • Export Database Table to JSON
  • Talend Aggregate Row
  • Talend Aggregate Sorted Row
  • Talend Buffer Input & Output
  • Talend Create Table
  • Talend tDenormalize
  • Talend Datatype Conversion
  • Talend tMap Type Conversion
  • Talend Filter Columns
  • Talend Filter Rows
  • Talend tMap filter rows
  • Talend tFileList
  • Talend tFixedFlowInput
  • Talend tForeach
  • Talend Fuzzy Matching
  • Talend Joins
  • Talend tMap Joins
  • Talend tMap Join Lookup
  • Talend tJava
  • Talend tJavaRow
  • Talend tJavaFlex
  • Talend tLoop
  • Talend tMsgBox
  • Talend tNormalize
  • Talend Pivot Columns
  • Talend Replace Data
  • Talend Replicate
  • Talend tRowGenerator
  • Talend tRunJob
  • Talend Rejected Rows
  • Talend Sample Row
  • Talend Sort Row Data
  • Talend SCD
  • Talend SCD Type 2 Manual
  • Talend Unite
  • Talend Unique Row
  • Talend Read Multi-Structure File
  • Talend Parent Child Job
  • Talend Execute SQL Queries

Copyright © 2021· All Rights Reserved by Suresh.
About | Contact | Privacy Policy