How to calculate total for a column with not all values filled

A

anoop.raj

Hi,

I am trying to get a OWC pivot table running through a Web page. I am
facing an issue while calculating total for one of the Fields. Not all
the cell for this field will have values. I am using the following code
to calculate the total and adding that field to the view.

Code:
Data as XML:
<z:row Classification='Country' CurrentLevel='331' TargetLevel='361'
Acct='9999AXH' Size='0.15' Return='0.26'/>

' add data axis
oView.DataAxis.InsertFieldSet oView.FieldSets("Size")

'add total size column
Set totalSize = oView.AddTotal("Size
Total",oView.FieldSets("Size").Fields(0), c.plFunctionSum)
oView.DataAxis.InsertTotal totalAvgSize
[code]

I am getting an error - <b>"Function cannot be applied to the given
field" </b>.  Appreciate your help in this.

Cheers
 
P

Pierre Archambault

Hi,

Try this formula:

=SUBTOTAL(9,A1:A100)

Replace "A1:A100" with your context.

Pierre
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top