2

I have a field called purchase price in orders table. When I query for those orders, I got 4 records. They are as follows

enter image description here

Here, as per the above query, when i sum purchase_price__c, i am getting 194.99. But, when I update the query to return the sum(purchase_price__c), I am getting the result as 216.

enter image description here

Is this issue due to sum function or if we sum the field, will it consider deleted records as well? I'm pretty confused here. Why do the numbers differ?

5
  • what does count(purchase_price__c) return?
    – kurunve
    Aug 13, 2019 at 11:50
  • Do you have multi-currency enabled?
    – Adrian Larson
    Aug 13, 2019 at 11:55
  • No @AdrianLarson. We do not have multi currency enabled
    – Skumar
    Aug 13, 2019 at 12:00
  • Count(Purchase_Price__c) is returning 4 records @kurunve
    – Skumar
    Aug 13, 2019 at 12:00
  • You could check the deleted records hypothesis. Do you have any?
    – Adrian Larson
    Aug 13, 2019 at 12:43

1 Answer 1

1

Notice the Deleted and archived records: Include in top right?

LIST:

enter image description here

SUM:

enter image description here

5
  • Thanks @Salesforce-sas. That was set to exclude when I was querying and that means it didnt include deleted records...I'm wondering why the sum is more when when compared to individual records. Please suggest
    – Skumar
    Aug 13, 2019 at 13:54
  • :). pls mark solved if solved Aug 13, 2019 at 13:58
  • I wish it would but it didnt @Salesforcesas. I'm getting the same no.of records with deleted records included and excluded.
    – Skumar
    Aug 13, 2019 at 14:00
  • can u verify in salesforce developer console? Aug 13, 2019 at 14:05
  • I did @Salesforcesas. I am getting the same total as workbench.
    – Skumar
    Aug 13, 2019 at 14:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .