2

Need to count field specific value in Views. I have 2 content types "project" and "task" In the task i have reference field for project (assign task to project) And another field "task_status" as a list: closed / open

I want to calculate the closed and total tasks so i can get the results in percentage:
closed_task / total_task * 100 How can i get the count for closed tasks value ?

Sorry for my bad English :)

1 Answer 1

0

You first create a views to show the list of open or closed task.

create a views with content type "project" remove all field then add a relation on task referenced field ,add title field with consider that you select relation field for it (because we want load task title instead of project title) then add filter "task_status" equal to close,then enable exaggeration and on title.and finally for better result you can get the title(or nid ) of project with contextual filter . it help you you can get only the list of tasks form specified project.( and finally create another page in that views with only one change, status=open ).

2
  • Thanks zhilevan ! I need to count the total and the closed task for that project. How can you do Math expression from one view to another ?
    – Schiwe
    Commented Jun 14, 2015 at 9:14
  • not it is not need, you can use https://www.drupal.org/project/views_field_view
    – Yuseferi
    Commented Jun 14, 2015 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.