top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Informatica: Breaking raws into multiple raws based on the values in a field?

+1 vote
467 views

My source data

id    |   value
10       a,b,c
20       d,e,f

I want output is

id    |   value
10       a
10       b
10       c
20       d
20       e
20       f

How to do this scenario

posted Jul 5, 2014 by Jaineesh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

you can try java transformation.

Exp 
=== 

id(I/O-String) 
value(I/O-String) 
value_var(V-String) = REPLACECHR( 0, value, ',', NULL ) 
value_len_var(V-Integer) = length(value_var) 
value_out(O-String) = value_var 
value_len(O-Integer) = value_len_var 

Connect id, value_out and value_len to java transformation and put the following code in the Java code tab and compile it.

if (!isNull("value_out")) 
{ 
  int len = value_len; 
  String str = value_out; 
  for (int i=0; i<len; i ) 
  { 
    value_out = str.substring(i,i 1); 
    generateRow(); 
  } 
} 
answer Jul 6, 2014 by anonymous
Thank you very much Salil Agarwal
Similar Questions
+1 vote

In my source table data is

s_name,p_name,value
s1 ,   p1,     10
s1 ,   p2,     xyz
s1 ,   p3 ,    abc
s2 ,   p1 ,    20
s2 ,   p2 ,    xyz
s2 ,   p3 ,    abc

I want two target tables, first table is based on s_name s1, second table based on s_name s2. Both table contains contains p_name and value.

The target table data like as

Table s1

p_name,value 
p1,    10
p2,    xyz
p3,    abc 

Table s2

p_name,value 
p1,    20
p2,    xyz
p3,    abc 
+1 vote

I want to create a mapping in Informatica Powercenter for the following functionality :

Initial Target Table Values : Field 1 : 100, Field 2 : 200, Field 3 : 300, Field 4 : 400.

Now, if the record is updated with a new value, say 500... then field 1 value should be moved to field 2.. and field 2 to field 3... and field 3 to field 4... and the new value should be inserted in field 1. so the output would be :

Field 1 : 500, Field 2 : 100, Field 3 : 200, Field 4 : 300.

How can I achieve above functionality?!

+1 vote

In Informatica's PowerCenter, is it possible to set a parameter's value based on the output of a stored procedure? The parameter I want to set is a parameter I defined in a flat-file data object.

+2 votes

I want to load multiple columns data into single column in informatica.

0 votes

I have a directory of files where each file is in one of three file formats. We can use the filename to determine the file format for mapping data. I would like to loop through all the files in the directory and based on the filename direct it towards the associated session mapping, delete the file on success, update the control table and then move to the next file. I'd like the execution to be deterministic. What are some of my options?

...