Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Calculations on crosstabs

edited December 2016 in End User
My crosstab is to show a summary of sales compared to budgets

The columns are sales types.

The rows are salespeople with a value for the Sales amount, the Budget
amount and a % of budget.

My query has the % calculation for each salesperson.

I need a way of accessing the total sales and budgets in the grand totals to
calculate the % correctly as the cross tab just adds these together.

Any suggestions?

Comments

  • edited December 2016
    Hi Rhonda,

    You can use the TppCrosstab.AfterCalc event to access the TppMatrix
    after it has been generated but before anything has been rendered.

    Then you can use the TppMatrix (TppCrosstab.Matrix) to access the values
    of any cells you need. Matrix.Value().

    See the help topics for TppCrosstab, TppMatrix, and TppElement for more
    help with these classes.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2016
    Thanks for that.

    So is it Crosstab1.Matrix[Row,Column].Value to access the cells ?

  • edited December 2016
    Hi Rhonda,

    The correct syntax to obtain a cell value would be
    CrossTab1.Matrix.Value[Column, Row];

    See the help topic for TppMatrix.Value for this and other interface
    declarations. I also suggest taking a look at the help topic for the
    TppElement class. This gives a nice diagram of the different parts of a
    crosstab component.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.