Single row converted into multiple rows using transformer stage

Input
-------------
name | no
--------------------
Bose 1
Mani 2
Arun 3
Output
-------------
name | no
--------------------
Bose 1
Mani 2
Mani 2
Arun 3
Arun 3
Arun 3
to get the Using transformer stage
help me ASAP

Questions by Bosemani

Showing Answers 1 - 21 of 21 Answers

abhishekk18

  • Apr 17th, 2017
 

Use xfmer looping as below:
Define: Iterations < = Input.no
Drag and drop all I/P cols to xfm target link
This will give the expected O/P

  Was this answer useful?  Yes

Sirisha d

  • Apr 18th, 2017
 

Define 3 loop variables in the transformer.
LoopVar1 : Input col1(name)
LoopVar2 : Input col2(number)
LoopVar3 : LoopVar3+1 ( Initiate this loop variable to 1)
In the Loop While condition give LoopVar3<=input col2(number)
Now, in the transformer target link, give
name -> LoopVar1
number -> LoopVar2
This gives the desired output.

  Was this answer useful?  Yes

Karthik

  • May 26th, 2017
 

In the transformer under LOOP Condition enter the following:
@ITERATION < = < COL_NAME >

  Was this answer useful?  Yes

Vaibhav G

  • Jul 6th, 2017
 

Hi Sirisha,
Your logic is correct. Only change is - the loop Variable3 should be initialized to 0 and not 1. :)
Thanks!

  Was this answer useful?  Yes

sandy

  • Sep 8th, 2017
 

Seq--->Tnx----Dataset

Seq: load input file
Tx:
1) sort(stage roperties --》
inputs--》partitioning --》partion type =Hash--》select one column --》select check box perform sort

2) in d loop condition --》Loop while --》right click, select system variable --》select, @ITERATION <=DSlink. input No

3) in d link derivation
DSlink.name ---Name
@ITERATION ----Required_NumRows

Taget: give the target file, extension is .ds

O/p:
Name No Required_NumRows
BOSE 1 1
MANI 2 2
MANI 2 2
ARUN 3 3
ARUN 3 3
ARUN 3 3

  Was this answer useful?  Yes

muni

  • Dec 20th, 2017
 

Using normalize component
in that transform < length(in.no) >
and assign drop to drag input to output

  Was this answer useful?  Yes

Sandy

  • Feb 15th, 2018
 

Tx => Functins=>string=>str(iput.name ,no)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions