Matrix Percentage Sub-Totals

  • I am trying to add a second sub-total to a matrix control. To do this I have created an un-necessary group and have then used the InScope function within the data cell to determine if I need to calculate it as per normal or differently.

    The reason for this second sub-total is to express the actual sub-total as a percentage of the next group out.

    It all works with one small problem - the sum function allows me to sum over a grouping, but when using the matrix control I have a column groups and a row groups - so I need to sum over both! But as best I can tell I can only specify a single group to the sum function.

    Here is a picture which might clarify things a bit: http://www.creative-dreaming.com/portals/0/temp/image001.jpg

    you can see from the picture the additional unnecessary group to provide me with a second sub-toal row (in red). However on this row I want to calculate the percentage of this sub-total over the sub-total of the next group out.

    Is this possible? If so how?

    Thanks.

  • Gosh - is this really hard to do? I was expecting someone to tell me how stupid I was being and how easy it is to do...

  • Since I can't even spell "Matrix Control", I kinda figured someone else would take a shot at it   I'm definitely NOT a GUI Guy...

    Take a look in Books Online for "ROLLUP Operator" and "CUBE Operator"... that should help.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply