Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
swuehl
MVP
MVP

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.

View solution in original post

2 Replies
swuehl
MVP
MVP

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
Author

Hi Stefan!

Thank you a lot! That made the trick!

Best regards!

Matias