Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
extbhoslpr
Contributor
Contributor

Using Peek and Previous creating duplicates rows

Hello,

I am trying to load the following script:

Fact:
Load
[AC_DOC_NO]&[FISCYEAR]&[COMP_CODE] AS key,
REPLACE(LTRIM(REPLACE("OI_EBELN",'0', ' ')), ' ', 0)&REPLACE(LTRIM(REPLACE("OI_EBELP",'0', ' ')), ' ', 0) AS [Purchase Order row/no]

FROM [source]

PO1:
LOAD
key,
if((IsNull([Purchase Order row/no]) or [Purchase Order row/no]= 0) and key= Previous(key), Peek('[Purchase Order row/no 1]'), [Purchase Order row/no]) as [Purchase Order row/no 1]
Resident Fact;

EXIT SCRIPT;

 

Now, when I only use [Purchase Order row/no] I get a total of 13 rows, but when I add [Purchase Order row/no 1] lots of duplicates are created.

Can someone please assist me on this.

 

 

Labels (1)
1 Reply
Sabrina_V
Partner - Creator II
Partner - Creator II

Peek - fonction de script | Aide Qlik Sense sous Windows . Please see the link : here