Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

count "Yes" answers for specific question

Hello there,

 

I am new to Qlik view  and I need your assistance to get the results of my survey answers displayed on a chart.

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_textsurvey_idquestion_id
Do you find the steps in the documents simple and straightforward?50efkjgbjsrrhjtrwj98735jksdfeharqonrtwe4377

 

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 and the unique user id who responded to that survey

answer_idanswer_dateanswer_textquestion_idsurvey_iduser_survey_id
5aaf981a2618ff00172703b02018-03-19T10:59:38.705ZYes5jksdfeharqonrtwe437750efkjgbjsrrhjtrwj98739d9e4780-2b64-11e8-9d76-3db6a4092cf1-1521457177592
5aaf981b3f2e72001633ca112018-03-19T10:59:39.000ZNo5jksdfeharqonrtwe437750efkjgbjsrrhjtrwj98739474d9d0-2b64-11e8-afa2-614a88624bdb-1521457162221

 

 

What I need to do is count how many times users responded with 'Yes' to the question"Do you find the steps in the documents simple and straightforward?" which has the ID '5jksdfeharqonrtwe4377' and how many responded with 'No'.

 

I tried this count({<answer_text={'yes'}>}if(question_text ='* Do you find the steps in the documents simple and straightforward?*',answer_text)) but it didn't work also if(question_id='5jksdfeharqonrtwe4377', Count({<answer_text={'Yes'}>}answer_text),) didn't work.

 

Can you please assist how can I achieve that result?

1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

maybe this:
=count( {< question_id = {'5jksdfeharqonrtwe4377'}, answer_text = {'Yes'} >} answer_id )

View solution in original post

3 Replies
avkeep01
Partner - Specialist
Partner - Specialist

Hi @Anonymous,

It is case sensitive. try:

count({<answer_text={'Yes'},question_text = {"Do you find the steps in the documents simple and straightforward?"}>}answer_text)
agigliotti
Partner - Champion
Partner - Champion

maybe this:
=count( {< question_id = {'5jksdfeharqonrtwe4377'}, answer_text = {'Yes'} >} answer_id )

Anonymous
Not applicable
Author

It worked!!!! thanks a lot Smiley Happy