DataTable multiple Filter conditions in one

Hi all,

I’m using the conditional cell styling to color rows based on two conditions:

{
    'if': {
        'filter' : 'p_strike_pro < num(0.0)'
    },
    'backgroundColor':'#4E5066',
    'color':'#FFFFFF'
},
{
    'if': {
        'filter' : 'c_strike_pro < num(0.0)'
    },
    'backgroundColor':'#4E5066',
    'color':'#FFFFFF'
}, 

I wonder if there is a way to “concat” those two conditions into one, e.g. 'filter' : 'c_strike_pro < num(0.0) OR p_strike_pro < num(0.0)'?

Many thanks in advance!

so far, the way you have done it is the only way…as it stands now, conditional arguments (OR, AND, etc) are not supported. hopefully conditional formatting with conditional arguments will be forthcoming in a future release.

1 Like

I figured that an AND condition seems to work like this

{
    'if': {
        'row_index': 'odd',
        'filter' : 'p_strike_pro > num(0.0)',
        'filter' : 'c_strike_pro > num(0.0)',
    },
    'backgroundColor':'#EBEBEB',
}, 

At least that works for me.

1 Like

The following will work:

        { 
            'if': {
                'filter_query': '{p_strike_pro } >0 && {c_strike_pro } >0',
            },
            'backgroundColor': '#EBEBEB'
        },