Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello there,
I am new to Qlikview and I need your assistance to get the results of my survey answers displayed in a pivot table
I have 2 tables loaded from a database for survey questions and answers.
One with the survey question text , the survey that the question belong to and the question ID
question_text | survey_id | question_id |
Do you find the steps in the documents simple and straightforward? | 50efkjgbjsrrhjtrwj9873 | 5jksdfeharqonrtwe4377 |
the second table contains the answers and the question id corresponding to that answer, the unique answers id, the answer dates, the survey id that the question and answer belong to, the user email and the unique user id who responded to that survey
answer_id | answer_date | answer_text | replied_question_id | survey_id | user_details | user_survey_id |
eoifjeclkmwe5673982 | 2018-03-19T10:59:27.204Z | Yes | 5jksdfeharqonrtwe4377 | 50efkjgbjsrrhjtrwj9873 | xyz@mail.com | 9474d9d0-2b64-11e8-afa2-614a88624bdb-1521457162221 |
eriofmkelegy3473200e | 2018-03-19T10:59:34.597Z | Thanks, it was great | 5jksdfe45rqonrtwe4370 | 50efkjgbjsrrhjtrwj9873 | abc@mail.com | 9c6a0d40-2b64-11e8-82e4-d1195c5377f8-1521457175572 |
9574857ltymtyshe8883 | 2018-03-19T10:59:38.404Z | Not really | 5jksdfeharqo382we4379 | 50efkjgbjsrrhjtrwj9873 | abc@mail.com | 9c6a0d40-2b64-11e8-82e4-d1195c5377f8-1521457175572 |
sacdapyui689343kkjdf6 | 2018-03-19T10:59:38.705Z | 4 stars | 5jksdfeharqonrtwe4390 | 50efkjgbjsrrhjtrwj9873 | anonymous | 9d9e4780-2b64-11e8-9d76-3db6a4092cf1-152145717759 |
What I need to do is display in a pivot table the user mail, the questions he replied to (translate the replied_question_id to question_text) and his answers
I tried this: if(replied_question_id=question_id, question_text,) but it didn't display anything.
Can you please assist how can I achieve that result?
Can you post the required output.
Thanks
@santhiqlik Thank you Priya, but it is still not working, actually it gives a blank cell.
Any other suggestion?
Hello @santhiqlik actually the question text disappeared.
I'm loading from a database using SQL statements, did I insert any incorrect iput in the script below?
Map_QuestionID:
Mapping Load
survey_id & '_' & "question_id" as SurveyQues , //composite key to get question text
question_text;
SQL SELECT`question_id`,`question_text`, `survey_id`, ......... From SurveyTable;
Load `_id` as answer_id
ApplyMap('Map_QuestionID',survey_id & '_' & replied_question_id ,Null()) as question_text
SQL SELECT `_id`, `answer_date`, `answer_text`,, .........From AnswerTable;
Hi Samar,
Please check below solution for your problem
Tab_Survey:
SQL SELECT`question_id`,`question_text`, `survey_id`, ......... From SurveyTable;
Map_QuestionID:
Mapping Load
survey_id & '_' & question_id as SurveyQues , //Removed " in question_id. it was added by mistake.
question_text
Resident Tab_Survey;
Drop table Tab_Survey;
Tab_Answer:
Load
`_id` as answer_id, //add all the required columns as we are not using * here
ApplyMap('Map_QuestionID',survey_id & '_' & replied_question_id ,Null()) as question_text;
SQL SELECT `_id`, `answer_date`, `answer_text`,, .........From AnswerTable;
Hello @santhiqlik
still the same results I tried to display the question_text in a list box, it's not showing any results.