Tables: Apply Filters - Dynamic Columns

Thomas_937381
Thomas_937381 Posts: 196
edited July 2020 in Questions

I have a variable number of columns that are added to a table; each column's name is a date. Looks something like this:

Column,2020-07-01,2020-07-08,2020-07-15
1,100,0,100
2,0,0,0
3,100,100,100
4,100,0,100

I have another table with each one of those dates a row. My intent is to use a batch workflow to do separate summaries on each one of those columns. I notice though that Tables: Apply filters to columns doesn't seem to like dynamic field references for columns. If I try to configure the 1st column to filter to be my {{date}} field (whose value is e.g. 2020-07-01, which is one of the column names), I get an error:

No matching column found for 'undefined'.

I've also tried advanced filter criteria in every way I can imagine to, including by a row index in my batched date table:

columns[{{index}}] == '100'
columns['{{date}}'] == '100'

I can't get any of these approaches to work. Is a dynamic column reference not possible in this way?

Tagged:

Best Answer

Answers

  • Thomas_937381
    Thomas_937381 Posts: 196
    edited July 2020

    @Dylan_478989 Thank you very much for the idea, but still no luck. At the top layer, I've got this in a Fields: Field formulas step:

    result = "columns['"+fields['date']+"'] == '100'"

    My {{date}} value is '2020-07-01', which yields the following (which I'm calling 'filter'):

    columns['2020-07-01'] == '100'

    When my Tables: Apply filters step runs in the child workflow, I get the following error message when I reference {{filter}} in the Advanced filter logic:

    You must provide either both a column name and filter critria, or valid advanced filter logic.

    Anything else I might be missing to try?

  • Dylan_191182
    Dylan_191182 Posts: 92 admin

    @Thomas_937381 if you put columns['2020-07-01'] == '100' directly into the action config does it work? If it does can you make sure the filter field is what you expect in the instance that is running Tables: Apply filters and dependencies are set up so the Tables: Apply filters step is dependent on the field formula step finishing?

  • @Dylan_478989 I'm not sure what was different, but I hard-coded this as you suggested (it worked), then shifted it back. It now seems to work, provided the formula is used to concatenate the Advanced filter logic. Thanks for the suggestion.