Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Sra1bandi
Contributor III
Contributor III

Crete new column from existing column

Hi Team,

i have column 

 

0-100

100-200

200-300 

300-400

400-500

500-600

600-700

700-800

800-900

900-1000

i need to create new column based on above is 

 

0-200

200-400

400-600

600-800

800-1000

 

Regards,

Sravan.

Labels (1)
1 Reply
jonashertz
Contributor III
Contributor III

Not sure what your purpose is but it looks like you need to take min max value for every second RecNo (Note difference to RowNo).
 
I purposely changed the row order and added an OrderBy just to be sure.
 
Subfield() without third parameter adds one row per subfield in the table.
 
 
t1:
Load * Inline [
Values
0-100
100-200
200-300
300-400
400-500
700-800
800-900
900-1000
500-600
600-700
];
 
t2:
Load
subfield(Values,'-') as Values,
RecNo()-Odd(RecNo()) as DoubleRecNo
Resident t1
Order by Values
;
drop table t1;
 
t3: 
Load
min(Values) & '-' & max(Values) as Values
Resident t2
group by DoubleRecNo;
drop table t2;