Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
BRI_SUBPROJM<>0 - checking if the ProjectID has any leader.
hope it will make sense, Table after some left joins:
1- ProjectID | 2 - 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) |
PROJ1 | PROJ2 | PROJ2 | ||
PROJ3 | PROJ4 | PROJ5 | 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,
would you be able to share sample data?
CustomerID | ProjectID | Ctype | CtypeLeader2doc | Leader1doc | Leader2doc |
12901 | 19V00072 | Type1 | Type2 | 19V01059 | 19P01100 |
19882 | 19J00035 | Type1 | Type2 | 19V01054 | 19P01103 |
19882 | 19N00008 | Type1 | Type2 | 19V01054 | 19P01103 |
19882 | 19J00043 | Type1 | Type2 | 19V01059 | 19P01100 |
The main purpose is to pull out the ctype value of the very first ProjectID - that contain null value on the BRI_SUBPROJM field (in a Projects table)
Currently the search happens but not in a loop, and only brings the second leading project = Leader2doc.
There are duplicate posts on this thread:
Regards,
Brett