Had to go back and change the code in a few places, and learnt that the syntax for cubefields can be quite different to the syntax for pivotfields.
You can't do subtotals on cubefields, you have to reference pivotfield eg.
When doing the subtotal, you have to state the field name twice as above.
When bringing int he field to a pivot, you have to state it once:
When adding a data field, it looks like this
Turned out to be quite a pain in the a$$.
I think there is some kind of background setting that I turned on by mistake,
The reason I say this is because I took a report from 2 months ago (where my old code worked fine), and that old file is also "looking" for Cubefield references.
Bookmarks