Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

gopal5879
New Contributor III

Need help - peek or previous function to get last record with val for current. more info in body

Hello folks need help, I am trying to use peek function or previous function, but not getting desired result.
I need NEW_ORGANIZATION field repeated with last  occurrence of ORGANIZATION until there is change in value.
Can someone please give me hint.

 

STATUSREFERENCEDATEWORKITEMIDORGANIZATIONNEW_ORGANIATION
Maintenance1/10/20182070400A1A1
Maintenance1/11/20182070400 A1
Maintenance1/12/20182070400 A1
Maintenance1/13/20182070400A2A2
Maintenance1/14/20182070400 A2
Maintenance1/15/20182070400 A2
Maintenance1/16/20182070400 A2
1 Solution

Accepted Solutions
Partner
Partner

Re: Need help - peek or previous function to get last record with val for current. more info in bod

This should work:

If(Len(ORGANIZATION)=0,Peek(NEW_ORGANIZATION),ORGANIZATION) as NEW_ORGANIZATION

Resident Table

View solution in original post

4 Replies
Partner
Partner

Re: Need help - peek or previous function to get last record with val for current. more info in bod

This should work:

If(Len(ORGANIZATION)=0,Peek(NEW_ORGANIZATION),ORGANIZATION) as NEW_ORGANIZATION

Resident Table

View solution in original post

Highlighted
gopal5879
New Contributor III

Re: Need help - peek or previous function to get last record with val for current. more info in bod

Thanks David ! Let me try

gopal5879
New Contributor III

Re: Need help - peek or previous function to get last record with val for current.info in body

David, I tried with one field, seems like it is working. I f I have another attribute, it does not work. Do I have to do something differently? For example if I want this logic for NEW_ORGANIZATION and NEW)GROUP as well?

 

       
STATUSREFERENCEDATEWORKITEMIDORGANIZATIONNEW_ORGANIATIONGroupNew_GROUP
Maintenance1/10/20182070400A1A1G1G1
Maintenance1/11/20182070400 A1 G1
Maintenance1/12/20182070400 A1 G1
Maintenance1/13/20182070400A2A2G2G2
Maintenance1/14/20182070400 A2 G2
Maintenance1/15/20182070400 A2 G2
Maintenance1/16/20182070400 A2 G2
      

 

 

Partner
Partner

Re: Need help - peek or previous function to get last record with val for current.info in body

The logic stays the same, just change the names of the fields