Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
marco_puccetti
Partner - Creator
Partner - Creator

Star Schema Key Definition

Hello, i need to know how to the following thing:

Table A

  Key A

  Field A

  Field B

Table B

  Key B

  Field C

  Field D


I need to have a Table C Having the Key of both A and B Tables! Is there any simply method to do this?


Table C

  Key A

  Key B

  Field E

  Field F


Thanks

Marco

11 Replies
avinashelite

we have many ways to do this:

*concatenation

*join

*applymap

etc

based on the data we can decided

avinashelite

simple way would be

Table A

Key A

  Field A

  Field B

Table B

  Key B

  Field C

  Field D




Table C

LOAD

key C as Key

from

tabel C


Load

Key A as Key

resident

Table A


Load

Key B as Key

resident

Table B



tresesco
MVP
MVP

May be linked table is what you need. Check this blog post: Concatenate vs Link Table

marco_puccetti
Partner - Creator
Partner - Creator
Author

So if Table C must be composed by all its fields plus all the keys needed how can i do by code?

Table C

A

B

C

D

....

N

..

Key A as Key, (from table A)

Key B as Key (from table B)


Thanks

Marco


Anonymous
Not applicable

You may use a linked table as Tresesco mentioned. Just make sure that you create a key on the dimensions itself and then join it to the Linked table you have created

marco_puccetti
Partner - Creator
Partner - Creator
Author

I have tried also with this statement in order to create a linked table but it is not properly working.

LINK_TABLE:

LOAD NURELAZ                              AS "NURELAZ" FROM $(QVD_PATH)\SVGES108.QVD (qvd);

LOAD NURELAZ &'#'& PRGMOV   AS "KEY"      FROM $(QVD_PATH)\SVGES116.QVD (qvd);

Thanks

puttemans
Specialist
Specialist

Hi Marco,

Importing the keys will not help, since they need a link with the underlying data in table C. Can you reconstruct the 2 keys with the data you'll load in C? This would be the simplest.

Else you need to identify a common field between table A/B and table C, and work with a mapping solution.

Regards,

Johan

marco_puccetti
Partner - Creator
Partner - Creator
Author

Yes but i need the table A and Table B.

Thanks

Marco

marco_puccetti
Partner - Creator
Partner - Creator
Author

A:

LOAD

     X,

     Y,

     Z

FROM

xx.QVD (qvd);

LEFT JOIN

LOAD

NURELAZ &'#'& PRGMOV   AS "KEY"

FROM

yy.QVD (qvd);

It would create a table A with all of its field with the KEY element isn't it?

When i run it it works but the application pause always, can you help me?

Thanks

Marco