Non-db kreporter fields not summing in tree view


I have a non-db kreporter field that I use to include calculate the weighted value of an opportunity. The vardef file looks like this:

<?php $dictionary['Opportunity']['fields']['weighted_amount'] = array( 'name' => 'weighted_amount', 'vname' => 'LBL_WEIGTED_AMOUNT', 'type' => 'kreporter', 'source' => 'non-db', 'kreporttype' => 'currency', 'currency_id' => 'currency_id', 'eval' => '{t}.amount * {t}.probability / 100' ); This field works as expected in a standard view report. If I use it in a treeview report and try to sum all the values for this field it will only display the first value. However, if I include the calculation as a custom function within the report it works as expected. See screen shot below: Any ideas why this might be? Thanks, Jonny


add property evalSQLFunction = X to your field definition

$dictionary['Opportunity']['fields']['weighted_amount'] = array(
    'name' => 'weighted_amount', 
    'vname' => 'LBL_WEIGTED_AMOUNT', 
    'type' => 'kreporter', 
    'source' => 'non-db', 
    'kreporttype' => 'currency', 
    'currency_id' => 'currency_id',
    'eval' => '{t}.amount * {t}.probability / 100',
    'evalSQLFunction' => 'X'

That sorted it :slight_smile: thanks very much!