Three filter on same data

I have Dashboard which uses data from Pandas df. It is one table on which I want to provide 3 filters. One for COUNTRY, second for STATE And Gender . Below is a code (only problematic part shown) which I am using


I don’t see any problematic in your code.

In fact I don’t see a code. :joy: :joy:

dash.dependencies.Output(‘table-container’, ‘children’),
[dash.dependencies.Input(‘dropdown’, ‘value’),
dash.dependencies.Input(‘dropdown1’, ‘value’),
dash.dependencies.Input(‘dropdown2’, ‘value’)])

def display_table(dropdown_value,dropdown1_value,dropdown2_value):
df = pd.read_csv(r’Dashboard Input Sample1.csv’)

if dropdown_value is None and dropdown1_value is None and dropdown2_value is None:
    return generate_table(df)
elif dropdown1_value is None:
    df =df[df['Usage_Segment'] == dropdown_value]
    return generate_table(df)
elif dropdown_value is None:
    df =df[df['RFM_Segment'] == dropdown1_value]
    return generate_table(df)

#elif dropdown_value is None and dropdown1_value is None:
 #   print(dropdown2_value)
  #  df =df[df['Churn_Category'] == dropdown2_value]
   # return generate_table(df)

    df =df[df['Usage_Segment'] == dropdown_value]
    df =df[df['RFM_Segment'] == dropdown1_value]
    #df =df[df['Churn_Category'] == dropdown2_value]
    return generate_table(df)
#if dropdown1_value is None:
#    return generate_table(df)