1

Trying to get a calculation at the end of an Aggregated Table or even Pivot Table in Views, but as it seems to be a bit of a two step process, I can't figure it out for the life of me...

I have the following table of user skills, pulled together using aggregation (for a number of reasons the way the data has to be gathered). I can also use a pivot to the same result.

enter image description here

I want to then be able to evaluate overall skill of each user by counting the Lows, Mediums and Highs for each user, multiplying them by 1, 2 and 3 respectively, and then add them together to a Total Skill value, per below:

enter image description here

Any ideas on how to do this, or an appropriate module that would give me this result?

0

Why don't you use THEME_preprocess_views_view_fields(&$var) function? In this function you may get every field of the view, and do any processing you want just before loading the view. just install devel module, and use kpr to see what variables are available.

2
  • Thanks @Drupalist - I'll give this a go - do you know any resources that give a good overview using this function?
    – Simo
    Apr 19 '15 at 23:17
  • it is not complicated. When the page is loaded every view calls this function before loading and all of the variables are stored in $var variable. for example the statement $view = $var['view'] returns the view or $view->type returns its type. You only check for the view type then by kpr see the available variables. in this link, there is a tutorial of theming views slideshow using this function. joetower.com/2011/11/drupal-7-theming-views-slideshow
    – M a m a D
    Apr 20 '15 at 4:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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