0

User Input Control - Filter multiple columns

I have a Klip with a table that connects to my SQL database. I've created some User Input Controls to filter the table rows.

I have an issue with one of them because I want to select an Item in the dropdown and if Column 'X' has the value OR Column 'Y' has the value, then filter as so.

This is causing issues as I can only filter by one column it seems.

How can I filter by both columns so that the item I pick in the dropdown will select the value in either column?


 

The above picture filters by name 'specialist' in Player 1 column. I want it so it shows rows if 'specialist' is in Player 1 OR Player 2 column.

 

Hope I've explained this ok.

 

Thanks

 

8 comments

  • Avatar
    Parker Selman Official comment

    Hi Lucas, 

    Thanks for the comment! We'd be happy to help with your column filter, but we'd likely need a bit more information on your data setup to understand how best to create these filters. If you email support@klipfolio.com with your question, someone from our support team would be happy to help in more detail. 


    Best,

    Parker

  • 0
    Avatar
    Adam Doogan-Smith

    Hey Jonny!

    If you want to filter the table to return rows where column X equals specialist OR column Y equal specialist you will need to add a hidden data slot to the table. From there you can write a quick formula to account for the multiple conditions like so:

    OR(@X:X=$player,@Y:Y=$player)

    This will return either "true" or "false". Then you can right click on the hidden data and select "Filter..." and only select the tickbox beside "true" and filter. This will return rows where column X or column Y is true.

    Hope this helps!

    Adam

  • 0
    Avatar
    Jonny Langleben

    Ok thanks.

     

    Do I add hidden data slot to the User Input Component or the main table? If the latter, how should I link my User Input Control dropdown to this filter?

     

    Thanks

  • 0
    Avatar
    Jonny Langleben

    OR(@X:X=$player,@Y:Y=$player)

     

    I'm only getting FALSE when I filter my hidden data... Do I need to do something with the Player variable first?

     

     

  • 1
    Avatar
    Jonny Langleben

    Ok so I managed to do this, thanks!

     

    I'm now into another problem whereby if I select 'ALL' for players, where I want all players, it gives me no results. This I assume is because of the OR functionality I included in the hidden data?

    How can I get the ALL to work with this too?

     

    Thank you!

  • 0
    Avatar
    Keely Davison

    Hi Johnny,

    For the all case you can add a bit more logic to get it to work

    Try this: 

    OR(@X:X=$player,@Y:Y=$player,$player="_all_")

    Keely

  • 0
    Avatar
    Lucas Costa

    Good morning, I have a similar problem, for example: I have 6 columns with the possibility of increasing the number of columns. the 6 columns are in the following order "Date", "Time", "Customer", "End", "C01", "C02". I would like to read all columns from column C01 into a filter the name of the columns and as soon as I select a column behind the column data in a graph.

  • 0
    Avatar
    Parker Selman

    Hi Lucas,

    Thanks for the comment! 

    We'd be happy to help with your column filters, but it looks like we'd need a bit more information about your data and how it's structured first. If you can send an email to support@klipfolio.com, someone from our support team would be happy to assist with your query. 


    Best,

    Parker

Please sign in to leave a comment.