Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Manoj_DataEnthusiast
Contributor
Contributor

taking previous records in straigh table

i have a requirement to take the previous records based on the below logic

f dependent =0 then pass 0.

if dependent=previous(taskname) then pass previous end time

next to that dependent = above of task name then that rows end time.

 

branch idbranchleveltasknamedependentstart timeendtime
11data layer.qvd 22/09/2020 10:00:00 am22/09/2020 10:10:00 am
12businesslayer.qvddata layer.qvd22/09/2020 10:10:00 am22/09/2020 10:20:00 am
13present1.qvdbusinesslayer.qvd22/09/2020 10:21:00 am22/09/2020 10:25:00 am
14present2.qvdbusinesslayer.qvd22/09/2020 10:21:00 am22/09/2020 10:24:00 am
15present3.qvdbusinesslayer.qvd22/09/2020 10:21:00 am

22/09/2020 10:24:00 am

 

3 Replies
Manoj_DataEnthusiast
Contributor
Contributor
Author

dependent =0 . first condition will get 0. how to write a script to get the 2nd and 3rd condition.. to take the previous records . dependent= previous(taskname).. sometimes the records may be two rows above our row..i mea

Chanty4u
MVP
MVP

did you tried this?

instead of previous use  above

=above(Dependent)

Brett_Bleess
Former Employee
Former Employee

You may need to load things into resident table and then use Order or Group by function to reload the resident table in the order you specify to be able to get things to work as you want I believe, hopefully that may be what you are missing.

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/prece...

https://community.qlik.com/t5/Qlik-Design-Blog/Preceding-Load/ba-p/1469534

Hopefully those may be of some help.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.