It seems that Views Calc cannot manage multiple values in a single integer/float field.
I´ve got a working view that calculates the sum of certain fields, but it breaks whan I use multiple values.
Is just my problem? Is it a bug? or maybe the module isn´t designed for working with multiple values?

Thanks for your help!

Rosamunda

Comments

karens’s picture

You're right, that probably won't work, so the code needs some fixing.

karens’s picture

Although it brings up the question of what should happen with them -- add them all?

Rosamunda’s picture

yeap, I thought that maybe it could add them all to the final ecuation.
ie. The new Views 2.0 version allows you to group all multiple values in a single row (in the table view), or show them in dirrerent rows. It would be great if Views Calc 6.0 version could add this feature.

Rosamunda’s picture

I don´t remember if I asked this some time ago, but a good alternative could be to work with Matrix Field...

Rosamunda’s picture

I´m experimenting with Views Calc to perform other calculations.
So, ie. I add this (%Decimal:views_calc_monto(field_views_calc_monto) *%Integer:views_calc_meses_adeudados(field_views_calc_meses_adeudado) * 24 / 1200) in the fields tab to calculate the monthly interest rate of certain aumonts of money.

But I have to create a single node with these fields:
views_calc_monto (the aumont of money that the person didn´t pay in time)
views_calc_meses_adeudados (months count)

I need to create a single node that can hold all aumonts of money, so I can perform a single calculation within a single node. As I need to create several nodes (each one for each indebted person), using this module is much better than computed module.

So that´s why I thought that being able to add a single node´s content with multiples values would be great.

Any ideas about this would be very much appreciated!

Rosamunda

scottrigby’s picture

Hi KarenS,
Have there been any further thoughts about this?
I just experienced a problem that may be related.
I have a Panels page with embedded views in two panels-panes:
1. A page display of a table with two rows...
2. A block display of the same view, but displaying a views_calc table.
What's happening is, for certain users the views_calc table is doubled... But for user/1 the same view calculates correctly.
Any ideas? :p
Scott

scottrigby’s picture

Oops, scratch that. This should be a new issue. I mis-read the title as "Error when calculate fields with multiple views". I'll post separately...

Rosamunda’s picture

* bump *

likewhoa’s picture

I think nornally all the values should be sum, maybe with array_sum?

Rosamunda’s picture

Could multiple values be combined with Computed Field? That way you could calculate listings in a more complex manner...

likewhoa’s picture

that's currently the way I have gotten around the views_calc limitation with multiple values is by using computed_field but this doubles the amount of fields on content types since all fields that have multiple values would need to be computed then passed to views_calc, it would be ideal if views_calc understood multiple values so this duplication of fields would not be neccessary. I believe that using array_sum would be ideal since it would not only sum up multiple values but also ignore empty rows thus give you an efficient way to sum up a bunch of values in a field.

Daniel A. Beilinson’s picture

Can you fix it?

tlogan’s picture

I'd like to see a fix for this also.

karens’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

The D6 version is no longer supported.