views:

347

answers:

2

I was wondering is there a way to have a column in share point that is a sum but only of the current column and the previous column

Like this

Title      Value     Total 

entry1       10        10
entry2       20        30 
entry3       20        50
A: 

I dont think its possible out of the box, but depending on your requirements it might be possible to create your own field type which does it. Here's some info on custom field types in SharePoint: http://msdn.microsoft.com/en-us/library/ms446361.aspx

Should this value automatically change if you change the view in the list? If so, you're in deep water since the value in a lists view is calculated using a CAML render pattern. I guess it would be possible to do it using JavaScript, but I wouldn’t recommend it.

If you always have the same view you can reuse the CAML query from the view to get the list item just before the one you are currently editing. Then you'll have to set the value of the field in the current list item as well as updating all other affected items.

JMD
A: 

If you have requirements for a display like this, you may find it easier to not store it as a column at all but just do a data form web part using SharePoint Designer (or your web part creation mechanism of choice) that outputs a table view that looks like what you want. I think it should be relatively easy to do that kind of running total with an XSLT template with a variable or two.

I don't think there is going to be an efficient way to do this with an actual column.

Sam Yates