Calculate percentage based on two fields, one of which is an embedded view I am trying to calculate a percentage based on two fields in my table. I am using views and I have a table which has 2 fields, one field is an aggregation of of all records and the other is an embedded view which has another number - I used the Views Field View module for embedding the field.

How can i get a percentage between these 2 fields. The Math Expression field is not supported in drupal 8 and I have also tried the views_simple_math_field and it didn't help me at all. Please help!
i tried in output code:

&lt;?php 
echo count($row-&gt;field_a) + count($row-&gt;field_a) ;
?&gt;


and the result is:


I modified the view, and used aggregation.



I modified the field a:



I modified the field b:



I modified the field php:



And the code:



And result: