Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
thymenkristen
Contributor III
Contributor III

How can i pivot my question data?

Hi Qlik community,

I'm trying to connect Survey Data in order to analyze it by using Qlikview.

Currently my script is looking like this:

Directory;
LOAD respondent_id,
Q1,
Q2,
Q3,
Q4,
Q5
FROM
Testdata.xlsx
(ooxml, embedded labels, table is Responses2);

Directory;
LOAD respondent_id,
[Vul hier deb_key in:],
[Mag ik u telefonisch een aantal vragen over uw ervaring met Wiltec stellen?],
[Hoe lang bent u al klant bij ons?],
[Wat is uw algemene tevredenheid over Wiltec],
[Hoe waarschijnlijk is het dat u Wiltec aanbeveelt aan vrienden of collega's?]
FROM
Testdata.xlsx
(ooxml, embedded labels, table is [Demographic information]);

Directory;
LOAD QuestionID,
Categorie,
Vraag
FROM
Testdata.xlsx
(ooxml, embedded labels, table is [Question Metadata]);

I want to Pivot my Q1, Q2 etc. and rename it to QuestionID so i Can connect it to my Question Metadata.

But i have no idea how?

Thanks in advance!

 

 

 

1 Solution

Accepted Solutions
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Try to use crosstable like:

 

Directory;
CrossTable(QuestionID, Data)
LOAD respondent_id, 
     Q1, 
     Q2, 
     Q3, 
     Q4, 
     Q5
FROM
Testdata.xlsx
(ooxml, embedded labels, table is Responses2);

Instead of using:

Directory;
LOAD respondent_id, 
Q1, 
Q2, 
Q3, 
Q4, 
Q5
FROM
Testdata.xlsx
(ooxml, embedded labels, table is Responses2);

 

Screenshot_1.jpg

View solution in original post

3 Replies
sunny_talwar

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Try to use crosstable like:

 

Directory;
CrossTable(QuestionID, Data)
LOAD respondent_id, 
     Q1, 
     Q2, 
     Q3, 
     Q4, 
     Q5
FROM
Testdata.xlsx
(ooxml, embedded labels, table is Responses2);

Instead of using:

Directory;
LOAD respondent_id, 
Q1, 
Q2, 
Q3, 
Q4, 
Q5
FROM
Testdata.xlsx
(ooxml, embedded labels, table is Responses2);

 

Screenshot_1.jpg

thymenkristen
Contributor III
Contributor III
Author

Thanks!