Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
As I need to manage the as in the below requirement in the script.
The schenorio is One Invoice number it contains 10 consignments and the first record only has "Itally" as I need to fill the "Itally" to the 10 consignments
Current table value is like as in the below:
Invoice Number | Consignment Number | Country |
---|---|---|
ADY89078 | 1 | Itally |
ADY89078 | 2 | |
ADY89078 | 3 | |
ADY89078 | 4 | |
ADY89078 | 5 | |
ADY89078 | 6 | |
ADY89078 | 7 | |
ADY89078 | 8 | |
ADY89078 | 9 | |
ADY89078 | 10 |
Required as like in the belwo:
Invoice Number | Consignment Number | Country |
---|---|---|
ADY89078 | 1 | Itally |
ADY89078 | 2 | Itally |
ADY89078 | 3 | Itally |
ADY89078 | 4 | Itally |
ADY89078 | 5 | Itally |
ADY89078 | 6 | Itally |
ADY89078 | 7 | Itally |
ADY89078 | 8 | Itally |
ADY89078 | 9 | Itally |
ADY89078 | 10 | Itally |
Chriss
I´m glad it works. The one you wrote was this:
If(Peek(Inv=Peek(shipno)),Peek(Name),Name) as Test
As you can see, your peek brackets are wrong placed, and also, you are comparing the field Inv with the previous shipno field. The correct way is to compare the same field: Inv=Peek(Inv)
It's what swuehl and Henric Cronström wrote, I just made the solution applied to your example.
Bye!
Load
[Invoice Number],
[Consignment Number],
If([Invoice Number]=Peek([Invoice Number]),Peek(Country),Country) as Country
From ...
HIC
Try something like
LOAD
InvoiceNumber,
ConsignmentNumber,
If( InvoiceNumber=peek(InvoiceNumber),peek(Country), Country) as Country
FROM Table ORDER BY InvoiceNumber, ConseignmentNumber;
Hi Henric and Swuehl,
Thanks for your reply, but the above expression is not solved it, could you please help me...
Test:
LOAD * Inline [
Inv,shipno,Name
LTN0813,1,TOM
LTN0813,2,TOM
LTN0813,3,TOM
LTN0813,4,TOM
LTN0813,5,TOM
LTN0813,6,TOM
LTN1000,1,TOM
LTN1000,2
LTN1000,3
LTN1000,4
LTN1000,5
LTN1000,6
];
LOAD
Inv,
shipno,
Name,
If(Peek(Inv=Peek(shipno)),Peek(Name),Name) as Test
Resident Test Order by Inv,shipno, Name;
Regards
Chriss
Try this way:
Test:
LOAD
Inv,
shipno,
If(Inv=Peek(Inv),Peek(Name),Name) as Name;
LOAD * Inline [
Inv,shipno,Name
LTN0813,1,TOM
LTN0813,2,TOM
LTN0813,3,TOM
LTN0813,4,TOM
LTN0813,5,TOM
LTN0813,6,TOM
LTN1000,1,TOM
LTN1000,2
LTN1000,3
LTN1000,4
LTN1000,5
LTN1000,6
];
It seems to work.
Yes, check your line with the peek functions, that's not what we suggested.
HI Iosu Garcia,
Thanks a lot.... its working fine now, could you please explain me why the previous one is not working fine, the logic and the expression also correct where I made the mistake.
Thanks for your reply swuehl, but the column names only I changed in the inline expression, please correct me if I am wrong.
Regards
Chriss
I´m glad it works. The one you wrote was this:
If(Peek(Inv=Peek(shipno)),Peek(Name),Name) as Test
As you can see, your peek brackets are wrong placed, and also, you are comparing the field Inv with the previous shipno field. The correct way is to compare the same field: Inv=Peek(Inv)
It's what swuehl and Henric Cronström wrote, I just made the solution applied to your example.
Bye!
Hi All,
Thanks for your valueable support, now I understand where I made the mistake.
Thanks again for your valuable support.
Regards
Chriss