Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Add a list of dates to a table

Hi,

Sorry if this has been covered before but I could not find anything that would help.

I have a table of product codes a - f and a start and end date.

I would like to create a table containing each individual product code against each individual date

A 01/01/11

B 01/01/11

C 01/01/11

A 02/01/11

B 02/01/11

And so on ...

I thought I could use autogenerate or a FOR RecordNummer = 1 TO (NoOfRows('xxx')) but could not get either to work. Any help would be nice.

Thanks

Gav.

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

What you need is a Cartesian join - the type of join where there are no common join keys. Simply load one field, and then load the other field, with the prefix Join, and you will get all the possible combinations of the two fields. Something like this:

Tab1:

load distinct Product resident ...;

join (Tab1) load distinct Date resident ...

this will do the trick.

View solution in original post

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

What you need is a Cartesian join - the type of join where there are no common join keys. Simply load one field, and then load the other field, with the prefix Join, and you will get all the possible combinations of the two fields. Something like this:

Tab1:

load distinct Product resident ...;

join (Tab1) load distinct Date resident ...

this will do the trick.

Not applicable
Author

Thank You,

Much simpler that what I was trying ....

Gavin