Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
idodel
Contributor III
Contributor III

Qlikview Loop Iteration function - ProjectID key

Hello Qliks! 

I have a Projects table that contain ProjectID field & might have a another project who leads the same Project above the first.

exists: -left joins the DOC for checking, not in infinite way. 

left Join
LOAD
DOC as Leader1doc ,
If(BRI_SUBPROJM<>0,BRI_SUBPROJM,DOC) as Leader2doc
FROM [Data\DOCPROJ.qvd] (qvd);

 

demand: Building a loop iteration that pulls out the very first ProjectID that doesn't contain any leader.

Any suggestions? 

BRI_SUBPROJM<>0 - checking if the ProjectID has any leader.

Thanks,

Labels (1)
10 Replies
Taoufiq_Zarra

can you share a sample data and the expected output ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
idodel
Contributor III
Contributor III
Author

Ok, hope it will make sense, Table after some left joins:

1- ProjectID2 - BRI_SUBPROJM (the Leader Project - if exists)

3- BRI_SUBPROJM

(the Leader Project of 2 -if exists)

4- BRI_SUBPROJM

(the Leader Project of 3- if exists)

 

Leader2doc (the very first leader - EXPECTED)
PROJ1PROJ2  PROJ2
PROJ3PROJ4PROJ5 PROJ5
PROJ6   PROJ6

 

Currently:  doing the search but not in a loop, and only brings the PROJ5 example.

We will have even more projects connected like 5 in row.

Thanks,

Taoufiq_Zarra

I'm sorry, but I didn't completely understand the objective.

you get the table

1- ProjectID2 - BRI_SUBPROJM (the Leader Project - if exists)

3- BRI_SUBPROJM

(the Leader Project of 2 -if exists)

4- BRI_SUBPROJM

(the Leader Project of 3- if exists)

and you want to add :

Leader2doc (the very first leader - EXPECTED)

if so what's the rule?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
idodel
Contributor III
Contributor III
Author

Hey,

The rule is some kind of loop for every ProjectID:

(BRI_SUBPROJM  is the leader of  the ProjectID)

while (BRI_SUBPROJM contain value (ProjectID),  iterate it.

once the BRI_SUBPROJM contain 0, pull out the very first ProjectID - the leader.

Thanks,

Brett_Bleess
Former Employee
Former Employee

Check out the following Design Blog post, should get you on the right track as far as the finding the row with the empty value part...

https://community.qlik.com/t5/Qlik-Design-Blog/Peek-vs-Previous-When-to-Use-Each/ba-p/1475913

If you want to further search the Design Blog area yourself, use the following URL:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

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.
Brett_Bleess
Former Employee
Former Employee

There are duplicate posts on this thread as well:

https://community.qlik.com/t5/QlikView-Scripting/Qlikview-Loop-Iteration-function-ProjectID/m-p/1662...

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.
idodel
Contributor III
Contributor III
Author

Hey, checked it out, and not quiet understand how am I able doing that in a loop as well.

please try to describe how is that going.

Thank you

idodel
Contributor III
Contributor III
Author

https://community.qlik.com/t5/New-to-QlikView/Looking-at-previous-rows-until-a-specific-value-is-fou...

This post is dealing with something that reminding my issue, but not including a loop search.

Can someone share how I is that going in the script ?  

Best Regards,

Ido

idodel
Contributor III
Contributor III
Author

Any suggestions for the issue?

Thanks