Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

peek()

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.

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: peek()

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
242423
424756242
4255424

Hope this helps you.

Regards,

Jagan.

5 Replies
prma7799
Honored Contributor III

Re: peek()

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

Re: peek()

Hi,
Try with 2nd parameter as 0 or 1.
and Remove 3rd parameter.
try like
load *,Peek('c1',1) as newtrend inline [
c1,c2
242,423
424,756
42,55
]

It must work.
Regards
Great dreamer's dreams never fulfilled, they are always transcended.
MVP & Luminary
MVP & Luminary

Re: peek()

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.

Not applicable

Re: peek()


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

];

Highlighted
MVP & Luminary
MVP & Luminary

Re: peek()

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
242423
424756242
4255424

Hope this helps you.

Regards,

Jagan.