Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

make a linktable

I have two different tables with different values and i want to connect the answers to te questions.

How can i make a good link table?

My first table is:

answers:
SQL SELECT answer0,
answer1,
enz...
answer_id
FROM mto1.answers;

my seccond table is:

Questions:
SQL SELECT
question,
question_nr
FROM mto1.`questions`;

How can i connect question 1 to answer 1?

Greetz,

Dirk

1 Reply
johnw
Champion III
Champion III

So field answer1 should match up to the question associated with question_nr = 1? I think something like this:

QuestionsAndAnswers:
CROSSTABLE (question_nr, answer) // one row per answer, keyed by question_nr
LOAD
answer_id
,answer0
,answer1
etc.
;
SQL SELECT
answer_id
,answer0
,answer1
etc.
FROM mto1.answers
;
INNER JOIN (QuestionsAndAnswers)
LOAD
question
,question_nr
FROMmto1.'QUESTIONS'
;