8 Replies Latest reply: Dec 5, 2013 3:31 AM by Kaushik Solanki Branched to a new discussion.

# Generate new records from existing records

I have a table like:

ItemCompAmount
1A11
1B4

Now I want one more record for all comp (A,B here) which is a calculated one (say Item ->Calc3) like

Calc3 = Item->1*2

So out put should be like:

ItemCompAmount
1A11
Calc3A11*2=22
1B4
Calc3B4*2=8

Note: In real scenario, there would be many more items and comps

• ###### Re: Generate new records from existing records

Try this,

Data:

From xyz;

Concatenate

Resident Data;

Regards,

Kaushik Solanki

• ###### Re: Generate new records from existing records

sorry, i should have mentioned that it would be Item specific rather than all items. Say there are 100 items, and I want 101st item to be like that (Calc3 = Item ->1 *2)

• ###### Re: Generate new records from existing records

i think there will be another field that it indicates last item, for example date...can you please mention that....

• ###### Re: Generate new records from existing records

Prem,

No it's not about last item. It is simply about creating a new record which has a reference to another/more records. It may be like:

Input:

Item Comp Amt

1     A     1

1     B     2

2     A     3

2     B     4

Output:

Item Comp Amt

1     A     1

Calc3     A     (amt of item->1)*2 =2

1     B     2

Calc3     B     (amt of item->1)*2 =4

2     A     3

2     B     4

Hope, it's bit clearer.

• ###### Re: Generate new records from existing records

What are the items ? How do you catch them ?

Fabrice

• ###### Re: Generate new records from existing records

Add a WHERE statement if the computation should be done on some items only.

Fabrice

• ###### Re: Generate new records from existing records

Nope ! Let me rephrase it:

Create a new RECORD which is calculated against some other records:

Like,

Input:

Item

1

2

3

Output:

Item

1

2

3

4             // 4 is calculated like item1+item2

• ###### Re: Generate new records from existing records

Try this,

Data:

From xyz;

Concatenate

first 10 Load Item,Comp,Amount*2 as Amount

Resident Data;

Regards,

Kaushik Solanki