count if it has reponse in other table or not

i have one table which has all the questions and one more table for the response which i am getting for each question. now i have to show the count of questions i have and count of number of response and count for non response question. i have tried making a condition  "if(response.id<>0,true,false)  , means if it has a response it will show true if not false so both are in same column and i want the count of all the true and false .


question           response      if(response.id<>0,true,false)

question 1           yes                         true

question 2                                          false

question 3           no                          true

question 4           maybe                     true


total question = 4   repsonded - 3     non- responded-1             

Hello Vikas,

Run a server action after each question was answered and in the server action use  list filter(required Condition)on response table and increase the count and for non responded get total questions number and subtract the reponded questions count.

Thanks

Hi Vikas,


Why not make an Aggregate that fetches all the information for you like this:

You join your Question Entity with your Answer Entity (make sure you use the With or Without join type). After that you can group on Questions.Id and can use the Count on Answer.Id.

This will give you all Questions with the number of answers on that Question. Now you can just check if the number of answers is 0, if so then the Question isn't answered.

Kind regards,
Martijn

Vikas C wrote:

i have one table which has all the questions and one more table for the response which i am getting for each question. now i have to show the count of questions i have and count of number of response and count for non response question. i have tried making a condition  "if(response.id<>0,true,false)  , means if it has a response it will show true if not false so both are in same column and i want the count of all the true and false .


question           response      if(response.id<>0,true,false)

question 1           yes                         true

question 2                                          false

question 3           no                          true

question 4           maybe                     true


total question = 4   repsonded - 3     non- responded-1             

Hi Vikas C

   Im trying your requirement little bit tricky.Im posting images of logic and entity filtration if you need to ask any queries reply to this .

1.Create your two entity datas First .

2. In Ok Button Save the datas of first entity question and by the createid of question entity assign to the Answer entity

3. In preparation Important thing to show seperate response and non response based on true false use SQL query select by default SQL having count output parameter use that in expression of response number to show in screen 

SyntaxEditor Code Snippet

select * from {Answer} where {Answer}.[Status] = 'true' 
select * from {Answer} where {Answer}.[Status] = 'false' 




Thanks in advance

soundarya