Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
Not applicable

How to check for the existence of relationship featuring a desired attribute?

Hi there!

I have this dataset

Employees:

IDName
1John
2Smith
3Joe

Offices:

IDCity
1New York
2London

Activities:

IDDescription
1Manager
2Operator
3Director

Employes_Offices_Activities:

EmployeIDOfficeIDActivitieIDEnabled
111True
112False
223True
311False
321False

I want to load Employee with an extra flag that determines if it's active or not. One employee will be active if he has one enabled activity in at least one office. Otherwise, he will be not active. I intend to get this Employee table:

Employee:

IDNameActive
1JohnYes
2SmithYes
3JoeNo

Joe is not active since he has no enabled activity in any office.

How can I perform this load? It would be great if you could provide some guidance. I'll appreciate a lot!

Thank you!

Matias

1 Solution

Accepted Solutions
MVP
MVP

Re: How to check for the existence of relationship featuring a desired attribute?

Maybe something like

MAP:

MAPPING LOAD

EmployeID, 'Yes' as Flag

FROM Employes_Offices_Activities

WHERE Enabled = 'True';


LOAD

     ID,

     Name,

      ApplyMap('MAP',ID,'No') as Active

FROM Employees;

Adapt the FROM parts to your original data sources.

2 Replies
MVP
MVP

Re: How to check for the existence of relationship featuring a desired attribute?

Maybe something like

MAP:

MAPPING LOAD

EmployeID, 'Yes' as Flag

FROM Employes_Offices_Activities

WHERE Enabled = 'True';


LOAD

     ID,

     Name,

      ApplyMap('MAP',ID,'No') as Active

FROM Employees;

Adapt the FROM parts to your original data sources.

Not applicable

Re: How to check for the existence of relationship featuring a desired attribute?

Hi Stefan!

Thank you a lot! That made the trick!

Best regards!

Matias