Aggregation functions does not work properly with data including null values

4 posts, 0 answers
  1. Casper
    Casper avatar
    11 posts
    Member since:
    May 2019

    Posted 15 Aug Link to this post

    Hi,

    I'm experiencing that simple aggregation functions doesn't work properly on fields 
    that includes null values (even though the documentation says that it excludes null values).

    I'm doing the aggregations in list rows (outside group) and using the inline json data sources.

    I see the following errors:

    - Avg: [= Avg(Fields.collectionIncludingNull)]
    Error: Type mismatch in expression 'Add'.

    - Max: [= Max(Fields.collectionIncludingNull)]
    Error: Cannot perform '<=' opreration on System.Decimal and Newtonsoft.Json.Linq.JValue

    - Min: [= Min(Fields.collectionIncludingNull)]
    Error: Cannot perform '<=' opreration on System.Decimal and Newtonsoft.Json.Linq.JValue

    Can you investigate this for me, and see if you spot the error in your end?

    Thanks!

    Cheers,
    Casper

  2. Casper
    Casper avatar
    11 posts
    Member since:
    May 2019

    Posted 15 Aug in reply to Casper Link to this post

    Another thing to mention is,
    If I'm building a custom function in which I try to exclude null values, the type is actually not of type null. It is of type Newtonsoft.Json.Linq.JValue, and I think that is root to the problem why your Aggregation functions (mentioned above) does not exclude null values.
    (Because they are not null)
  3. Neli
    Admin
    Neli avatar
    147 posts

    Posted 20 Aug Link to this post

    Hi Casper,

    The error message Error: Cannot perform '<=' opreration on System.Decimal and Newtonsoft.Json.Linq.JValue appears when you try to compare different types of data- jvalue and decimal.

    When it comes to the check of null values, we already know about this unexpected behavior which is cased by a bug. It is already logged in our Feedback portal - JsonDataSource evaluates NULL values incorrectly. Feel free to vote for it to increase its priority.  

    Regards,
    Neli
    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
  4. Casper
    Casper avatar
    11 posts
    Member since:
    May 2019

    Posted 20 Aug in reply to Neli Link to this post

    Hi Neli,

    Thanks for your reply.
    I have voted on the other ticket.

    Cheers,
    Casper
Back to Top