View Full Version : Feature Request
kettle_anonymous
03-10-2006, 09:02 AM
Add Constants feature can become very powerful if constants can be added to input conditionally (based on logic). Right now only static constants that are allowed.
jbleuel
03-13-2006, 06:42 AM
Could you give us more info or an example for a better understanding ;-)
Thanks,
Jens
kettle_anonymous
03-14-2006, 05:59 PM
Lets say I have an excel file with 2 sets of data spanning 20 rows. Rows 1 through 10 belong to a type value 1 and rows 11-20 belong to a type value 2. Lets say the type value is a column in my source data set. I want to add a constant field on the value in the 'type value' column.
if <type value column> == 1
constant = X
if <type value column> == 2
constant = Y
Hope this makes sense.
jbleuel
03-14-2006, 11:21 PM
Why do you need the "non static constant"? Could you give us information about the hole transformation process? May be we could solve the problem another way...
Thanks a lot,
Jens
kettle_anonymous
03-15-2006, 11:04 AM
I want to transfom this data
col1col2col3col4
A1BC
D1EF
G1HI
J2KL
M2NO
into this
col1col2col3col4col5
A1BC1
D1EF2
G1HI3
J2KL1
M2NO2
where column 5 is a constant value based on column 1
thanks
MattCasters
03-15-2006, 11:11 AM
Hi,
Just write a small piece of javascript that compares col2 current record with the previous one.
Then just add a number allongside. Should be about 10 lines of code like this:
var prevCol2;
var col5 = 1;
if (prevCol2 != null )
{
}
prevCol2 = prevCol;
...
Cheers,
Matt