Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi !
I have a mission to import a file , with the recordlayout like this, and Create/Group records
The RecordType 10 states that this is a new record
RecordType | Value | RecordNo (this is the one I want to create when loading the file) |
---|---|---|
10 | Donald | 1 |
20 | Goofy road 4 | 1 |
30 | 9922 | 1 |
10 | Daisy | 2 |
20 | Mickey road 5 | 2 |
10 | Scrooge | 3 |
20 | Abbey road 1 | 3 |
30 | 1234 | 3 |
40 | London | 3 |
Any tips ?
Regards Pär
Try the following script:
load *,If(RecordType=10,If(IsNull(Peek(RecordNo)),1,Peek(RecordNo)+1),Peek(RecordNo)) as RecordNo;
load * Inline [
RecordType,Value
10,Donald
20,Goofy road 4
30,9922
10,Daisy
20,Mickey road 5
10,Scrooge
20,Abbey road 1
30,1234
40,London
];
Try the following script:
load *,If(RecordType=10,If(IsNull(Peek(RecordNo)),1,Peek(RecordNo)+1),Peek(RecordNo)) as RecordNo;
load * Inline [
RecordType,Value
10,Donald
20,Goofy road 4
30,9922
10,Daisy
20,Mickey road 5
10,Scrooge
20,Abbey road 1
30,1234
40,London
];
maybe something like:
if(RecordType=10, NumSum(1, Peek('RecordNo')), Peek('RecordNo')) as RecordNo;
Thanks !
Works like a dream ....
/Pär