How do I show a percentage value in a views_field? How do I show the percentage value in a views_field?


col(1) (group by) field_a  
col(2) (count)field_a *100/number of results " -->@total"


I'm still not able to use @total in a computed_field or a math-expression_field or a global_custom_field.

I need this value for the Highcharts module, so using "aggregation plus" also seems not the solution.

Using a PHP field inside views is highly risky for security reasons as I read here in other answers.
to achieve some calculations I see 2 different solutions.

1/ You create a custom sql query with (db_query) inside a custom module that gonna trigger a view to render, your select clause will make the calculation for you so you will have your result that you are going to display inside a custom field in your view.
You can see the actual query you are executing by using the devel module and then tweak it.

2/ You can use computed_field module but it's a really dangerous thing to integrate PHP inside a field somewhere, because if your php breaks, you will break your complete site, and need to rollback your database. But I don't suggest this solution because it's really risky for your site.

I hope it helps

Cheers