redash icon indicating copy to clipboard operation
redash copied to clipboard

Pivot table "only" filter is fragile when query result grows

Open susodapop opened this issue 5 years ago • 2 comments
trafficstars

Issue Summary

The built-in filter tools of the pivot table let me choose to display "only" one filtered value. But dimensions that I filter this way break if more unique dimension values are added to the query result. For example: assume my pivot table has columns a, b, and c. I choose to filter and only show column b. If I rerun the query and now records exist that would make a d column, my pivot table will show columns b and d. This happens because d was not present in the results when I filtered initially. Which isn't intuitive. I expect the "only" filter would continue to apply as long as the specified value was part of the query result.

Steps to Reproduce

I reproduced this on the preview instance. Screenshots of the behavior appear below.

  1. Visit the preview query here.
  2. Change Values to exclude parameter from load_favorites to NA. Click execute.
  3. Observe that the pivot table shows login events and load_favorites events.

Full reproduction steps:

  1. Make a query that generates a pivot table with at least two columns
  2. Configure the pivot table to show "only" one of those columns.
  3. Re-execute the query in a way that would introduce another column
  4. Observe that the new column appears alongside the column picked in step 2.

I did this using Redash events metadata by purposely excluding load_favorites events. When you change the parameter to exclude NA (blank) events, load_favorites appears in the query result and throws-off the filter.

Excluding load_favorites

Screen Shot 2020-07-15 at 18 55 14

Permitting load_favorites

Screen Shot 2020-07-15 at 18 55 20

Technical details:

  • Redash Version: v9 Beta
  • Browser/OS: All (FF/Chrome/Safari/Edge)
  • How did you install Redash: SaaS

susodapop avatar Jul 15 '20 23:07 susodapop

me too!!!

gaecoli avatar Jul 17 '20 02:07 gaecoli

Oh, this is SO annoying, please fix it. :(

flaviocordova avatar Sep 24 '22 11:09 flaviocordova