79650133

Date: 2025-06-02 18:11:29
Score: 0.5
Natty:
Report link

The problem was how Taipy binds values to the table, but finally managed to get it done :) Here is how should the filter_category function look like:

def filter_category(state):
    if not state.selected_filter:
        return
    
    state.filter_display_texts.append(state.selected_filter)
    value = state.data.groupby(state.selected_filter)[['depositAmount', 'withdrawalAmount', 'totalRevenue']].sum().reset_index()
    state.tables_data.append(value)
    print('Filtering data by:', state.selected_filter)
    print('State tables', state.tables_data)
    with builder.Page() as table_data:
        with builder.layout("1"):
            for idx, _ in enumerate(state.tables_data):
                with builder.part("card"):
                    builder.table(data=f"{{tables_data[{idx}]}}", page_size=10)
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Cak Finli