Field Filter Problem

I tried to use a database field [XEUSER.USERNAME] as a filter
but it can't display on my question,and I changed another field[xeuser.remark],and it displayed, so can anyone tell me what's the metter about the field "username"?

this is another image

sorry I'm a new, only can upload one image in the topic


and this is the definition of database table

Hi @Feasoul
You cannot use Field Filters with table aliases:
https://www.metabase.com/blog/field-filters/index.html

1 Like

thank you for reply. But forgive my slow-witted. I think I didn’t use a table aliases. do you mean it like the “XEUSER” of “XEUSER.USERNAME”?
Or the field “USERNAME” used in the SELECT can’t be used as a field filter?

@Feasoul You are using "DP"."XEUSER" "Xe User", where "Xe User" is a table alias - and since you’re using a Field Filter on that table, then it will reference the original table, which you’re then not including in your query, because you have aliased it.

got it, So should I modify the “Xe user” to the Original table name “XEUSER” ?

@Feasoul You should not use table aliases, when using Field Filters.


I have tried in this way. I'm sure there's no table alias,so what's the matter?
I'm really getting mad about this problem......

@Feasoul
As noted in the Field Filter documentation about Oracle - you have to use full table reference

FROM "DP"."XEUSER"

https://www.metabase.com/docs/latest/users-guide/13-sql-parameters.html#the-field-filter-variable-type

And USERNAME has to be one of the Field Types listed here:
https://www.metabase.com/docs/latest/users-guide/13-sql-parameters.html#creating-sql-question-filters-using-field-filter-variables

thank you ,I've been read the rule for many times,
but it still doesn't work.
I really can't understand the diff between "Username" and "Duty" ,cause of they are the same use,the same type,the same Database type(varchar(32)).

but there is one thing, the count of "username" is 40
but the "duty" is 3,is this the problem?

@Feasoul

  1. Post “Diagnostic Info” from Admin > Troubleshooting
  2. Which version of ojdbc8.jar ?
  3. Go to http://metabase.example.com/api/field/:id for both USERNAME and DUTY and post the responses here. You can find the ID for each field by looking in the URL of your browser, when you go to Admin > Data Model > (database) > (table) > (column) :gear: