locked
Which expression is better? RRS feed

  • Question

  • I am in the process of re-writing 30 existing reports. My question is which syntax is more effecient or better?

    =Sum (Fields!Amount.Value, "DataSet")/100

    or

    =Sum (Fields!Amount.Value/100, "DataSet")

    Thanks!

    Tuesday, June 28, 2005 9:09 PM

Answers

  • This is the slightly more efficient way of doing it:
    =Sum(Fields!Amount.Value, "DataSet") / 100

    Divisions are generally more expensive than adding items. By dividing only once the overall expression is more efficient. But depending on the actual report and the number of underlying data rows, you may not experience any significant difference.

    -- Robert

    Wednesday, June 29, 2005 4:38 AM

All replies

  • This is the slightly more efficient way of doing it:
    =Sum(Fields!Amount.Value, "DataSet") / 100

    Divisions are generally more expensive than adding items. By dividing only once the overall expression is more efficient. But depending on the actual report and the number of underlying data rows, you may not experience any significant difference.

    -- Robert

    Wednesday, June 29, 2005 4:38 AM
  • Thank You!

    Is there a book or website to read up on best practices for this sort of thing?
    Or is it just learned along the way?
    Wednesday, June 29, 2005 4:23 PM