How to sum time component using aggregate SUM(HH:MM)

2 posts, 0 answers
  1. Raed
    Raed avatar
    1 posts
    Member since:
    Oct 2014

    Posted 26 May Link to this post

    Hello

    I Have a column that has data in the date - HH:MM format, example "00:22", how to sum all the values in that column. 

    One more thing the data is coming from a JsonDataSource that has null values in date column, using the (IsNull, ??, IIf) to check for null does not seem to work. for example: =IIF(Fields.actualWorkHrs Is NULL, "T", "F") always returns falls even when there are null values in the actualWorkHrs  field

     

    thanks. 

  2. Silviya
    Admin
    Silviya avatar
    414 posts

    Posted 29 May Link to this post

    Hi Raed,

    DateTime values cannot be summed. Instead you can get the hours and minutes from the field and sum them. Note that Sum() aggregate function skips the NULL values, so you don't need to include Is Null check in the expression.

    As for the expression checking if the field is NULL, you are correct. I also made some tests and it seems that it will only returns True if the entire property is missing. For example, check this screenshot: https://www.screencast.com/t/JUP9rsB8. However, this is not an expected behavior and we consider this as bug. I have logged it on your behalf on our Feedback Portal as Bug Report (JsonDataSource evaluates NULL values incorrectly) and also vote for it. This way you can follow the status of the item and when will be released. As a token of gratitude, I have updated your Telerik points. Thank you for bringing this to our attention.
     
    Best Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top