8 Replies Latest reply on Jul 3, 2018 8:47 AM by Shinichiro Murakami

# Need help with Date calculations

Table 1 inner joined with Table 2

TABLE 1

 Activated_Date column1 Count of orders of table1 Count of orders of table 2 4/18/2018 A 5 4/19/2018 B 6 4/20/2018 C 8 4/21/2018 D 10 4/22/2018 E 50 4/23/2018 F 20 4/24/2018 G 30

TABLE 2

 Track Out Date col1 Count of orders of table 2 3/11/2018 A 30 4/2/2018 B 20 4/3/2018 C 10 4/4/2018 D 10 4/5/2018 E 10 4/6/2018 F 10 4/7/2018 G 10 4/8/2018 H 10 4/9/2018 I 10 4/10/2018 J 10 4/11/2018 k 10 4/12/2018 L 10 4/13/2018 M 10 4/14/2018 N 10 4/15/2018 O 10 4/16/2018 . 10 4/17/2018 . 10 4/18/2018 A 10 4/19/2018 A 10 4/20/2018 A 10 4/21/2018 A 10 4/22/2018 A 10 7/3/2018 A 10

Output:

 Activated_Date column1 Count of orders of table1 Count of orders of table 2 4/18/2018 A 5 60 4/19/2018 B 6 4/20/2018 C 8 4/21/2018 D 10 4/22/2018 E 50 4/23/2018 F 20 4/24/2018 G 30

 From the day  of activation(Activated_date)  till today(from Track out date), I need the count of orders from table 2. In this case, for 'A' activated date is 4/18/2018 so I need count of orders of table 2 from 4/18/2018 till today (7/3/2018)which will be 60

Any help is appreciated!

Thanks,
Swathi

• ###### 1. Re: Need help with Date calculations

Hi Swathi,

Maybe you need to check your Join again, I guess that you want to join them by column1 = col1.

Your join should look something like this:

• ###### 2. Re: Need help with Date calculations

Hi Swathi

Assuming you use 10.5 or newer, you should use "Range Join"

Thanks,

Shin

• ###### 3. Re: Need help with Date calculations

Hi Katya,

Join is on other columns..this is just an example..data is different..but I want to know how can we achieve this using date calculations-

From the day  of activation(Activated_date)  till today(from Track out date), I need the count of orders from table 2. In this case, for 'A' activated date is 4/18/2018 so I need count of orders of table 2 from 4/18/2018 till today (7/3/2018)which will be 60

Thanks,

Swathi

• ###### 4. Re: Need help with Date calculations

Still using Tableau 10.1 :-(

• ###### 5. Re: Need help with Date calculations

......

Shin

• ###### 6. Re: Need help with Date calculations

Is there a way to do using calculations?

From the day  of activation(Activated_date)  till today(from Track out date), I need the count of orders from table 2. In this case, for 'A' activated date is 4/18/2018 so I need count of orders of table 2 from 4/18/2018 till today (7/3/2018)which will be 60

• ###### 7. Re: Need help with Date calculations

Very troublesome on 10.1.

Need this kind of data prep.

Join and create all the possible combinations

Of course, this cannot handle huge size of data set.

Thanks,

Shin

1 of 1 people found this helpful