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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
gopal5879
Creator
Creator

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
Labels (1)
1 Solution

Accepted Solutions
DavidM
Partner - Creator II
Partner - Creator II

This should work:

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

Resident Table

View solution in original post

4 Replies
DavidM
Partner - Creator II
Partner - Creator II

This should work:

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

Resident Table

gopal5879
Creator
Creator
Author

Thanks David ! Let me try

gopal5879
Creator
Creator
Author

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
      

 

 

DavidM
Partner - Creator II
Partner - Creator II

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