Wednesday, March 21, 2012

Incorrect Subtotal in Matrix

Hi,

I am using the matrix element. in the data part i m using the aggregate function CountDistinct. and when i m taking the subtotal for this value across rows the total is coming wrong. while in the same matrix i have other data values also which uses functions SUM, for these the Subtotal is coming correct.

Can somebody tell me why this is happening with CountDistinct function.

Thanks in advance.

Count will count the number of occurrences of this record in a row or column. It will not add them together. Even if your value is more than 1, it will only count 1 time and add 1 to the total.
SUM adds the values in the rows together. That's why the subtotal will work correctly but CountDistinct not.

Hope this can help,
|||

Thanks for a quick response eduard,

what should i do to get the sum of all the rows where the countdistinct function is used?

|||Any work around on this?|||

the 'sum distinct' workaround might help

look for the whitepaper by 'fang wang' which has this sample in

sql

No comments:

Post a Comment