Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date join between tables

Hi,

Hope someone can help me with this issue. I have three tables that I wanna join together; the first one is the date table with all dates from 2011-01-01 to today, the second table is the sales table with all the sales information and the third table i the product table with information about the products.

Table 1 - Dates (contains all days from 20110101)

- DateID

- Year

- Month

- Day

- ....

Table 2 - Sales (contains a unique row for each sales)

- SalesID

- SalesDateID

- ProductID

- ....

Table 3 - Products (contains a unique row for each product)

- ProductID

- ProductName

- ....

One ProductID can have many SalesID and a ProductID may be sold one day and the next day there is no sales for that ProductID which means the ProductID will have no connection to a SalesDateID if there is no sales that day.

What I wanna do is to join SalesDateID with DateID so that I can create a chart showing the sales result for a choosen ProductID. The chart should show ALL days during a period and the number of sales - 0 if there were no sales that day.

It should look like this for at choosen ProductID:

Date
ProductID
Number of sales
2011-01-011234456
2011-01-02123473
2011-01-03123412
2011-01-0412340
2011-01-051234908
2011-01-0612340
2011-01-071234454
2011-01-08123417
2011-01-0912340
.... and so on....

Hope someone can help me with the join or expression to solve this.

Thanks!

Fredrik

Labels (1)
11 Replies
er_mohit
Master II
Master II

use after load table 2 in th end before semi colon write this where exit(SalesID);

Not applicable
Author

Hi Frederik,

please get a listbox for the date in Table 1 - Dates and the Date in Table 2 - Sales

Would be interesting whether they are the same and what dates belong to 2012 Oct.

Ciao

Klaus