Allow/Ignore zeros in valueGetter and aggFunc

Hello :slight_smile:

I am facing an issue where I am trying to make a calculation for a column in AG Grid, however I have some zeros in the two column which I use for calculation, and I want to ignore those because my current calculation shows either '-Infinity%" or β€˜NaN’. Anyone know how I can do that?

I am using Ag grid enterprise and row groups.

{
        "headerName": "Difference",
        "valueGetter": {
            "function": "((params.data.X - "
            "params.data.Y) / "
            "params.data.X) * 100"
        },
        "aggFunc": "avg",
        "valueFormatter": {"function": "Math.round(params.value) + '%'"},
    },

Hello @kjurukova,

To ignore a non-value:

params.value ? (Rest of function) : null
1 Like