Cross-filtering not working

{
  "browser-info": {
    "language": "en-US",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "Cp1252",
    "java.runtime.name": "Java(TM) SE Runtime Environment",
    "java.runtime.version": "1.8.0_271-b09",
    "java.vendor": "Oracle Corporation",
    "java.vendor.url": "http://java.oracle.com/",
    "java.version": "1.8.0_271",
    "java.vm.name": "Java HotSpot(TM) 64-Bit Server VM",
    "java.vm.version": "25.271-b09",
    "os.name": "Windows 10",
    "os.version": "10.0",
    "user.language": "en",
    "user.timezone": "America/Los_Angeles"
  },
  "metabase-info": {
    "databases": [
      "h2",
      "sqlserver"
    ],
    "hosting-env": "unknown",
    "application-database": "h2",
    "application-database-details": {
      "database": {
        "name": "H2",
        "version": "1.4.197 (2018-03-18)"
      },
      "jdbc-driver": {
        "name": "H2 JDBC Driver",
        "version": "1.4.197 (2018-03-18)"
      }
    },
    "run-mode": "prod",
    "version": {
      "tag": "v0.37.4",
      "date": "2020-12-17",
      "branch": "release-x.37.x",
      "hash": "e0d5287"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

While I am trying to link a question to a dashboard filter, I do not get the correct options,

Hi @xasimak
It would be helpful with more details like how to reproduce and screenshots.
Also, latest release is 0.37.5, and you should migrate away from H2 if you’re using Metabase in production:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html

Thank you for your immediate reply. The DB I am currently using in MS SQL Server.

With regards to my issue,


I have created the Dashboard you may see on the screenshot and I want to use Plans table as the driving question. I want to link PLN_NUM field to ID dashboard filter and I am doing this as you may see on the 2nd screenshot. However, it seems that Plan number and ID filters are connected somehow. What am I doing wrong?

I have also linked ID filter with the below questions as you can see on 3rd screenshot.

Screenshot #22

Screeshot #3

@xasimak I’m unsure how you ended up selecting “Plan Number” (filter) to update “ID” (another filter).
I cannot reproduce, but it’s difficult without knowing exactly how “Plans” question is built.
I have a feeling that you’re seeing this issue:
https://github.com/metabase/metabase/issues/13186

I reproduced the steps -with slightly different filters- just to be sure but I still have the same issue.

Plans question is pretty simple (SELECT PLN_NUM, PRD_CODE, PLN_ST_CODE
FROM ODS.PLN). Once I click on “Click behavior”, I get the screen shown on screenshot #1 (that shows the 3 columns available).

I select “PLN_NUM” and then “Update a Dashboard filter” and I get the list of available dashboard filters (actually not all of them, why?) as shown on #2.

Once I click on “Plan number”, the only option I get is “Fund Code” (as shown on #3)

This is how I end up with linking Plan number to Fund code (or ID in my initial example).

image

@xasimak But which type of question is it? Simple/Custom or Native/SQL?
And depending on if it is a Native/SQL question, then which filter type are you using in the question, and which filter type are you using on the dashboard.
It definitely seems like there’s a bug, since you shouldn’t be able to update a filter with another filter. I’m just having a little difficult reproducing, so filter types would be helpful.

  • All my questions are Native queries.
  • In the question I use a variable. I do not define the type of the variable explicitly but the respective field in the database is varchar.
  • On the dashboard the filter is ID.

I changed the type of the dashboard filter from ID to Category and now it works fine.

@xasimak But what is the Filter Type in the SQL question? There’s Number, Text, Date, and Field Filter.
If you are using Field Filter, then the database column type and Field Type defined in Admin > Data Model have an impact.

@flamber The SQL question is an EXECUTE statement of a Store Procedure with 3 params (varchar, date, date): EXECUTE PORTAL.SP_GetPlanValuationForPeriod {{Plan_Num}},{{Date_From}}, {{Date_To}}
I do not use any further filtering on the question. These 3 filters appeared automatically once I typed my execute call.
Also I did not change any data type in my Data Model. The default datatype (as it comes from the DB) for PLN_NUM is Text.

@xasimak I can see the problem now. I have created an issue for it:
https://github.com/metabase/metabase/issues/14473 - upvote by clicking :+1: on the first post

1 Like