This is a migrated thread and some comments may be shown as answers.

Aggregation functions does not work properly with data including null values

3 Answers 264 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Casper
Top achievements
Rank 1
Casper asked on 15 Aug 2019, 11:05 AM

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

3 Answers, 1 is accepted

Sort by
0
Casper
Top achievements
Rank 1
answered on 15 Aug 2019, 11:44 AM
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)
0
Neli
Telerik team
answered on 20 Aug 2019, 07:19 AM
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
0
Casper
Top achievements
Rank 1
answered on 20 Aug 2019, 08:21 AM
Hi Neli,

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

Cheers,
Casper
Tags
Report Designer (standalone)
Asked by
Casper
Top achievements
Rank 1
Answers by
Casper
Top achievements
Rank 1
Neli
Telerik team
Share this question
or