Calculated field in Charts

Hi im new to mongo and used Qliksense and a Sql database in the past. My question is about using the calculated fields in Charts. At the moment it is very limited so it makes it difficult for me to display what I want on the charts and to create new fields. I would like to know if all the aggregation operators can be used in the calculated field and if not when you create an aggregation pipeline that displays what you need , how do you save that into a field in the data , to reuse and manipulate in other charts.
Sorry if my question is unclear , still very new to this.

Hi @johan_potgieter -

Calculated fields in Charts can use one of two syntax:

  • “Simple expressions”, which can contain field names, the four basic arithmetic operators and brackets, e.g. (sensor.temp - 32)*5/9
  • MQL expressions, which can contain any valid “operator expressions” from the MQL language, e.g. { $multiply: [ "$price", 0.075 ] }

All calculated fields become an $addFields stage in the final pipeline. If you want to do something more complex like pre-group the data, you can do this by entering full aggregation stages in the query bar rather than use calculated fields.

Let me know if you have any more questions.

1 Like

Thanks Tom this helped. I am doing the mongodb university courses know. Our company switched from an sql database but we were also using Qlik to display our charts. We want to use mongo charts now , so was wondering is there a way that links to videos can be added to the charts for certain events. So if i click on part part of a pie chart one video plays and another when i click on a different part?

That’s not possible today, but we are planning our next set of interactivity features so I’ll see if we can do something like this.


Thanks that will be great. Will more kinds of charts also be released , like a spider chart and gauge? Then the other thing I would like to know is , do you plan to make it possible to do cross filtering between charts?

Gauge chart is already available (in cloud-hosted Charts). We are also planning a spider/radar chart in upcoming months. Cross-filtering is on our plan but will take us a bit longer to get there.


1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.