Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

datanibbler
Esteemed Contributor

How to do this - do I have to join or what?

Hi,

I have the following requirement:

- I have a table with a series of bookings, each one with a date, a user_name who did it and a week that I created

- On the other hand, I have a table with a nr. of names (of employees who were assigned to a specific area in a specific week) with a
   week_number.

=> Now I want to filter the table with bookings for only those ´bookings which were made by employees who were assigned a specific
     area - in the week of the booking.

=> How would I go about that? Do I have to "many_join" all the bookings with all the employees (by week)?`

Thanks a lot!

Best regards,

DataNibbler

5 Replies
marwen_garwachi
Contributor II

Re: How to do this - do I have to join or what?

is it possible to  publich a sample file ?

datanibbler
Esteemed Contributor

Re: Re: How to do this - do I have to join or what?

Yes, of course.

I have made a small Excel file - here the info is on two separate sheets, but that doesn't matter much - in reality, the info is in two different tables, both already in the QlikView_database.

Also, the sample is greatly simplified - there are several bookings, all within the same week, but not all of the employees were there in that week - I want, by way of joining or otherwise, to filter out the bookings which were effected by employees who were there in the week of the booking.

Thanks a lot!

stevenrtaylor
Contributor II

Re: How to do this - do I have to join or what?

Temp1:

Load

     Employee

Resident Employees

Where Area = DesiredArea;

Inner join(Temp1)

Load

     *

Resident Bookings;

Without more information, this is about as detailed as I can get.

Not applicable

Re: How to do this - do I have to join or what?

Simply Join the 2 tables on the composite key WEEK_NO & '|'&EMPLOYENAME

Employee
Employee

Re: Re: Re: How to do this - do I have to join or what?

I think its an inner join on name/user and Week/week which filter out combinations from the booking of week/user that aren't in the employee sheet

Capture.PNG.png

Bookings:

LOAD Booking_date,

    week,

    User

FROM

(biff, embedded labels, table is Bookings$);

inner join (Bookings)

LOAD Name as User,

    Week as week

FROM

(biff, embedded labels, table is Employees$);

Community Browser