Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
youss123
Contributor III
Contributor III

Graph Expression : count

hello All,

I want to count the number of patients who responded to all the 3 questions : question 1 , 2 , 3.

But this expression is not working. 

It does not give the number of patients how reponded the 3 questions  , but rather the number of patients who answered one of the 3 questions.

=count({ <[question]={'question1'}, [question]={'question2'}, [question]={'question3}, [responded]= {'Yes'} >}distinct [KEY - Patient])

Many thanks in advance

1 Solution

Accepted Solutions
MarcoWedel

You did not yet share how your data actually looks like.
To account for a possible response status per question, maybe one solution could be instead:

MarcoWedel_0-1679228267352.png

 

MarcoWedel_1-1679228292908.png

 

=Count({$<[KEY - Patient]=p({<[question]={'question1'},[responded]={'Yes'}>})*p({<[question]={'question2'},[responded]={'Yes'}>})*p({<[question]={'question3'},[responded]= {'Yes'}>})>} distinct [KEY - Patient])

View solution in original post

11 Replies
PedroNetto
Partner - Creator
Partner - Creator

Hi @youss123 !

Try: count({ <[question]={'question1', 'question2', 'question3'}, [responded]= {'Yes'} >}distinct [KEY - Patient])

youss123
Contributor III
Contributor III
Author

Thank you for your reponse but it's not working 😕

PedroNetto
Partner - Creator
Partner - Creator

Share a example of your data please.

MarcoWedel

maybe like this?

=count({$<[KEY - Patient]=p({<[question]={'question1'}>})*p({<[question]={'question2'}>})*p({<[question]={'question3'}>}), [responded]= {'Yes'}>} distinct [KEY - Patient])
youss123
Contributor III
Contributor III
Author

Thank you for your reponse  but it doesn't work either

vinieme12
Champion III
Champion III

Try below

=count({<[KEY - Patient]={“=count({<[responded]={‘Yes’}>}distinct [question])=3”}>}distinct [KEY - Patient])

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Gabbar
Specialist
Specialist

Try this:
=count({<[KEY - Patient]=p({<[question]={'question1'},[responded]= {'Yes'}>*<[question]={'question2'},[responded]= {'Yes'}>*<[question]={'question3'},[responded]= {'Yes'}>})distinct [KEY - Patient])

MarcoWedel

You did not yet share how your data actually looks like.
To account for a possible response status per question, maybe one solution could be instead:

MarcoWedel_0-1679228267352.png

 

MarcoWedel_1-1679228292908.png

 

=Count({$<[KEY - Patient]=p({<[question]={'question1'},[responded]={'Yes'}>})*p({<[question]={'question2'},[responded]={'Yes'}>})*p({<[question]={'question3'},[responded]= {'Yes'}>})>} distinct [KEY - Patient])
MarcoWedel

or maybe:

=Count({$<[KEY - Patient]={"=Min(question='question1' and responded='Yes') and Min(question='question2' and responded='Yes') and Min(question='question3' and responded='Yes')"}>} DISTINCT [KEY - Patient])

 ?