Hi, this is my problem:
I have created my own content type with CCK and it has 2 fields like this:
Content Type1: Companies
field1: Company name
filed2: number of workers
There are some users and they add their company name the number of worker that work there. I want to make math operations (add, subtract, multiply, etc) with the number of workers of the company that I choose. For example to the workers of one company I want to add a number and to the workers of the other company I want to multiply for another number. Al these results Im going to show in a Display in Views in a table. I tried to do this with Views_Calc but this module acts on the entire array of the number of workers, I dont know how to make the math operations only with the number of workers of the company that I choose, not with all the companies. I dont know PHP but I tried to use Custom Field but I can not solve my problem.
I would appreciate any help. Thanks
Comments
Computed Field or custom module
Generally when someone want to calculate a value, the calculation is the same on all nodes of the same content type. How will you define what calculation will be done on an individual company? Perhaps you can add a field to the content type to define the calculation.
You can either use the Computed Field (http://drupal.org/project/computed_field) or a custom module to accomplish this. Either way you will need to use PHP to perform the calculations.
Thanks for your answer, I
Thanks for your answer, I used this module but I couldn't solve my problem, please you know where I can read an extra information about Computed Field, I need to read some examples about this.
My best regards
you need to study php to get
you need to study php to get it to work, or post an example!
Computed Field examples and Rules
You can find the documentation and several examples at http://drupal.org/node/126522/.
Another option might be to use the Rules module to perform the calculation when the content is saved.
I read the examples about
I read the examples about Computed Field that you give me and I finally obtain the results that I was looking for. Thanks for share your knowledge with me