speroo
speroo

Reputation: 41

Making Multiple rows into column in informatica

I have a source table that have values like shown

source table

i want the output to be like this

target table

i tried many things but to no avail.

is there anyway to do this using the infromatica developer client?

thanks in advance

Upvotes: 0

Views: 461

Answers (1)

Maciejg
Maciejg

Reputation: 3353

I assume you need to join first C41 with first C42, etc. - as you did not mention how to deremine which of the numerical rows should get tied to IN.

Looks like you need to generate sequence for each Field_Name, split the data flow into two, based on Field_Name, and join back using the generated sequence.

The Expression should generate a sequence by having following ports:

(variable port) v_seq = IIF(prev_Field_Name = Field_Name, v_seq+1, 1)
(variable port) prev_Field_Name = Field_Name
(output port)   out_seq = v_seq

Now the flow would be like this:

Src--SQ--Exp_generate_seq--RTR--(C41)-\
                              \-(C42)--Jnr_by_seq

Upvotes: 2

Related Questions