Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good Day!!
I'm hoping someone can help me in implementing the following logic inside the Script.
Load
Record1 then
Load Record2 then
Compare Record1 vs Record2 then
## Do some logic
Repeat
How can i do something like that?
Whoever's assistance is much appreciated!
Nico
Sorry, Wanted to post this to your Name.. My bad!
Good Day Marcus,
Please provide some assistance on the above mentioned.
O can now properly identify the Final Increments.
What is however happening is that fact that the records, which are final increments from the start (i.e. No increments) as situated below.
Po1001
Po1001.1
Po1002 <-- This record is thrown away, because it has no increment.
Po1003
Po1003.1
What can i do to keep those increments? I've been trying some weird combinations, but im not getting it to work?
Please see code below:
//PO
POReworkTableLoad:
LOAD
if(WildMatch(IncrementedPONumber,'*.*') = 1,Right(IncrementedPONumber, len(IncrementedPONumber)-Index(IncrementedPONumber, '.'))) as FinalPoNumber,
IncrementedPONumber as Increments,
Left(order_number,6) as LeftOrderNUm,
order_number ;
LOAD
if(NOT WildMatch(order_number,'*.*'),order_number&'.0',order_number) as IncrementedPONumber,
order_number
Resident POs Order By order_number DESC;
POReworkTableFinal:
LOAD
FinalPoNumber as varTestingPORec,
order_number,
if(peek(varTestingPORec,-1) < [FinalPoNumber],'Final Increment','Previous Increment') as KeepThisPOrecord
RESIDENT POReworkTableLoad
ORDER BY [order_number] DESC;
Use IterNo() and While functions.
Hi Nico,
try this for your final load
POReworkTableFinal:
NOCONCATENATE LOAD
LeftOrderNUm,
FinalPoNumber as varTestingPORec,
order_number,
if(peek('LeftOrderNUm',-1) = [LeftOrderNUm],'Previous Increment', 'Final Increment') as KeepThisPOrecord
RESIDENT POReworkTableLoad
ORDER BY order_number desc;
Nope.. didn't work =(
I'll Keep trying!
Ok what do you see? I'm assuming that it's the 'Previous Increment', 'Final Increment' that's being fixed here, in which case my code works -
order_number | varTestingPORec | KeepThisPOrecord | LeftOrderNUm |
---|---|---|---|
Po1001 | 0 | Previous Increment | Po1001 |
Po1001.1 | 1 | Final Increment | Po1001 |
Po1002 | 0 | Final Increment | Po1002 |
Po1003 | 0 | Previous Increment | Po1003 |
Po1003.1 | 1 | Final Increment | Po1003 |
I tried it? But it did'nt work?
I played around with my previous attempt and this seemed to do the trick in my final load?
POReworkTableFinal:
LOAD
LeftOrderNUm,
FinalPoNumber as varTestingPORec,
order_number,
if(peek(LeftOrderNUm,-1) = LeftOrderNUm,'Previous Increments','Final Increment') as Status
//if(peek(varTestingPORec,-1) < [FinalPoNumber],'Final Increment','Previous Increment')) as KeepThisPOrecord
RESIDENT POReworkTableLoad
ORDER BY [order_number] DESC;
Drop Table POReworkTableLoad;
It should'nt work? The logic doesnt make sense.. but it does? Let me try your code again!
(0.o).. lol..
Now it worked perfectly! I knew that i was onto something with my code... just didn't know how to finish it off!
Regards,
Nico Oberholzer
Looks almost identical to the condition I sent through, aside from the omission of single quotes, but as long as it works...
Can you mark this question as answered now
Yea, would it make any considerable difference?
Thanks again for the help!