Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
JianangZhao
Contributor II
Contributor II

How to build data modeling

Hello everybody, I am one new Qlik Sense user, and now i meet one problem on how to link and build data model between two tables (A & B). In table A, each day with has one record, and we can use the date as primary key; and for the second table B, fore each day, there will be ten thousands records, and we can also use the date as primary key. My requirements is that how can select one day in table A, and then return two days' data from table B(the day we select and the prior day)? Every reply will be appreciated.
2 Replies
acrodrigues03
Partner - Contributor III
Partner - Contributor III

Hi!

 

Simplest way would be to duplicate table B.

 

TABLE B:

LOAD

Date ,

Date as OriginalDate

.....

FROM (TABLE B SOURCE);

 

CONCATENATE (TABLE B)

LOAD 

Date-1 as Date ,

Date as OriginalDate

FROM (TABLE B SOURCE);

 

What this is going to do is to associate each value of Table B to the following date and also create a "OriginalDate" field so that you can keep track of which one is the data from today, or from the previous day. 

 

Because you have more records on table B, you can also do that in table A. 

 

TABLE A:

LOAD

Date ,

Date as OriginalDate

.....

FROM (TABLE A SOURCE);

 

CONCATENATE (TABLE A)

LOAD 

Date-1 as Date ,

Date as OriginalDate

FROM (TABLE A SOURCE);

 

But here you would have to filter by "OriginalDate" to get the day and the prior day of data from table B

JianangZhao
Contributor II
Contributor II
Author

Hi acrodrigues03,

Thanks for your suggestion, i build one mid-table, to connect the table A(Summary_1) and table B(Transaction_1) by key Daykey_1 and DAY_NUMBER1, and one Daykey_1 will mapping two DAY_NUMBER1, then my data modeling could be build successfully.  Thanks one more time.

clipboard_image_0.png