Error when calculate fields with multiple values

Rosamunda - July 5, 2008 - 00:28
Project:Views Calc
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

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

#1

KarenS - July 5, 2008 - 10:55

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

#2

KarenS - July 5, 2008 - 10:56

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

#3

Rosamunda - July 5, 2008 - 15:28

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.

#4

Rosamunda - July 5, 2008 - 16:35

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

#5

Rosamunda - July 5, 2008 - 22:46

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

#6

scottrigby - January 23, 2009 - 19:37

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

#7

scottrigby - January 23, 2009 - 19:36

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...

#8

Rosamunda - January 30, 2009 - 03:27

* bump *

#9

likewhoa - February 3, 2009 - 01:01

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

#10

Rosamunda - February 5, 2009 - 14:59

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

#11

likewhoa - February 5, 2009 - 16:18

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.

#12

Daniel A. Beilinson - June 4, 2009 - 17:47

Can you fix it?

#13

tlogan - June 16, 2009 - 21:18

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

 
 

Drupal is a registered trademark of Dries Buytaert.