Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community
Kindly see the Attached QVW.
I have mentioned my requirement there as per the Example
Regards
Aviral
add the load statement below above your first load and replace the old column with the new one in your hierarchy load.
Emp:
LOAD *,
if([Reporting To]='VACANT',DivisionalHead, [Reporting To]) as [Reporting To New];
LOAD EmpID,
Name,
Department,
[Reporting To],
emp_code,
emp_location,
MANAGER_POSN,
DivisionalHead
FROM TESTDATA.qvd(qvd);
Hierarchy:
Hierarchy (EmpID,[Reporting To New],Name,Manager,Name,EmpTree,'/',Level)
LOAD *
RESIDENT Emp;
DROP TABLE Emp;
add the load statement below above your first load and replace the old column with the new one in your hierarchy load.
Emp:
LOAD *,
if([Reporting To]='VACANT',DivisionalHead, [Reporting To]) as [Reporting To New];
LOAD EmpID,
Name,
Department,
[Reporting To],
emp_code,
emp_location,
MANAGER_POSN,
DivisionalHead
FROM TESTDATA.qvd(qvd);
Hierarchy:
Hierarchy (EmpID,[Reporting To New],Name,Manager,Name,EmpTree,'/',Level)
LOAD *
RESIDENT Emp;
DROP TABLE Emp;
Thank You Jsaradhi
Your Logic is working Perfectly
But I also want the MANAGER_POSN to be used in the Code.
In my example, there is one Manager who is blank but in future if there are 2 or more null than i identify with MANAGER_POSN.
just modify the load statements to something like:
LOAD *,
// if([Reporting To]='VACANT',DivisionalHead, [Reporting To]) as [Reporting To New],
if([Reporting To]='VACANT',SubField(link1,'_',1),[Reporting To]) as [Reporting To New],
if([Reporting To]='VACANT',SubField(link1,'_',2),MANAGER_POSN) as MANAGER_POSN_New;
LOAD EmpID,
Name,
Department,
[Reporting To],
emp_code,
emp_location,
MANAGER_POSN,
DivisionalHead,
DivisionalHead&'_'&MANAGER_POSN as link1
FROM
TESTDATA.qvd
(qvd);
of course, now MANAGER_POSN_New and [Reporting To New] should be the fields you use. you can even drop the older fields at the end of the script if necessary.
Thank You Very-2 Much for the Solution and devoting your time on this issue.
Regards
Aviral
np. good luck.