When we have a first object with such a key:
onlygroupbycolsprotocol/ic50: null
If next objects in the data array actually contain numeric values for that field, it will not matter for Flexmonster and instead of the specified aggregation by average, it is just counting the number of results. Is there a way to fix it?
If the first object actually has values that are non-null, it makes things work, but we can't rely on it.
Hello,
Thank you for reaching out to us.
Flexmonster might define data as string values by default if the first value is null
. Sum and average aggregations are not supported for non-numeric fields. Therefore, it displays count aggregation, distinct count, etc. In such cases, component behavior requires defining the type of the fields. The proper way of defining the field's data type is using mapping. For example,
mapping: {
"Quantity": {
type: "number",
},
"Price": {
type: "number",
},
}
Kindly check the following JSFiddle for reference: https://jsfiddle.net/flexmonster/10xw6ch3/.
Please let us know if it works for you. Feel free to contact us if other questions arise.
Kind regards,
Nadia
Hello Nikita,
Hope you are doing well.
We were wondering if you found our solution helpful. Could you please confirm if it works for you?
Looking forward to hearing your feedback.
Kind regards,
Nadia
Sure, mapping solved the issue.
Thank you!
Hello,
Thank you for the feedback.
We are glad to hear that it works for you.
As always, feel free to reach out to us in case other questions arise.
Kind regards,
Nadia