Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
tab1:
load *,Peek('c1',2,'tab1') as newtrend inline [
c1,c2
242,423
424,756
42,55
];
i cud get data of c1,c2 but nothing is displayed in newtrend.please help me.
Hi,
Peek() gives you the previous record values, for first record you don't have any value before that, that is why you are getting null in the first record in newtrend column. The values populates from the second row onwards.
c1 | c2 | newtrend |
---|---|---|
242 | 423 | |
424 | 756 | 242 |
42 | 55 | 424 |
Hope this helps you.
Regards,
Jagan.
Hi Teja,
Please check below code.
tab1:
load * inline
[
c1,c2
242,423
424,756
42,55
];
tab2:
LOAD * , Peek('c1',2,'tab1') as newtrend
Resident tab1;
drop Table tab1;
It may be helpful to you.
Thanks
Hi,
Try this script
tab1:
load *,Peek('c1') as newtrend inline [
c1,c2
242,423
424,756
42,55
];
Also you can use Previous() like below
tab1:
load *,Previous('c1') as newtrend inline [
c1,c2
242,423
424,756
42,55
];
Hope it helps you
Regards,
Jagan.
thanks all,
jagan, if i do as follows, it shoud give all cell values i.e 42,242,424 bcoz after c1 it interprets as 0 and from 1 st cell value, it gives all cell values; but it is giving only 242,424 y?
tab1:
load *,Peek('c1') as newtrend inline [
c1,c2
242,423
424,756
42,55
];
Hi,
Peek() gives you the previous record values, for first record you don't have any value before that, that is why you are getting null in the first record in newtrend column. The values populates from the second row onwards.
c1 | c2 | newtrend |
---|---|---|
242 | 423 | |
424 | 756 | 242 |
42 | 55 | 424 |
Hope this helps you.
Regards,
Jagan.