Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Giovane_BXB
Partner - Contributor
Partner - Contributor

A Tricky Join

I'm having some trouble joining two tables as described below.

Let’s take the first table as follows:

Table 1

Name

Date

John

02/15/2024

Andrew

02/20/2024

Thomas

03/10/2024

Clark

03/12/2024

Jefferson

03/25/2024

Peter

04/01/2024

Susan

04/10/2024

Anderson

04/20/2024

Mary

04/25/2024

Joe

04/30/2024

 

Now, let’s take the second table:

Table 2

              X

             Y

             Z

       Parameter             Date

1

2

3

02/01/2024

4

5

6

02/15/2024

7

8

9

03/01/2024

10

11

12

03/15/2024

13

14

15

03/25/2024

16

17

18

03/30/2024

19

20

21

04/01/2024

22

23

24

04/08/2024

25

26

27

04/15/2024

28

29

30

04/20/2024

 

I need to add parameters X, Y, and Z to Table 1 as follows:

Table 1

Name

Date

                X

                Y

                 Z

John

02/15/2024

4

5

6

Andrew

02/20/2024

4

5

6

Thomas

03/10/2024

7

8

9

Clark

03/12/2024

7

8

9

Jefferson

03/25/2024

13

14

15

Peter

04/01/2024

19

20

21

Susan

04/10/2024

22

23

24

Anderson

04/20/2024

28

29

30

Mary

04/25/2024

28

29

30

Joe

04/30/2024

28

29

30

 

That is to say, the field “Parameter Date” from Table 2 must be used to define the Parameters to be added to Table 1.

How can I do that?

Thanks for your help.

Labels (1)
1 Solution

Accepted Solutions
igoralcantara

Maybe I am over simplifying but if that date matches between those two, simply rename the date field in one table to equal the date field in the other. If not, have you try IntervalMatch?

Check out my latest posts at datavoyagers.net

View solution in original post

3 Replies
igoralcantara

Maybe I am over simplifying but if that date matches between those two, simply rename the date field in one table to equal the date field in the other. If not, have you try IntervalMatch?

Check out my latest posts at datavoyagers.net
Giovane_BXB
Partner - Contributor
Partner - Contributor
Author

Hello Igor,

The Dates between the tables don't match. There's an interval in table 1 that will match one date in table 2. However, you gave a good tip: Using the IntervalMatch function. I'll try it. 

Thank you, mate.

igoralcantara

Glad to help!

Check out my latest posts at datavoyagers.net