I have an in database connection to an EDL table and I want to exclude certain data criteria based on multiple columns.
I have included a very simplified table example below. I would like to filter dataset to only keep "Value" data where Column 1 = TL and Column 2 = LOGI, AND where Column 1 = O and Column 2 = DZNA. Essentially, eliminating/keeping rows based on specified column 1 and column 2 relationships. Any tips on how to do this?
Column 1 Column 2 Value
TL DZNA 100
TL LOGI 1400
TL LOGN 2000
O DZNA 105
O EGTD 100
Solved! Go to Solution.
Can you build your filter with the Filter In-DB tool? The language may change depending on the database, but generally:
(Column 1 = "TL" and Column 2 = "LOGI") OR (Column 1 = "O "and Column 2 = "DZNA")
Thanks for responding. Filter In-DB tool accepted your the language you proposed.
Do you know how I can take this a step further, and include multiple Column 2 variables? For example, (Column 1 = "TL" and Column 2 = "LOGI", "LOGN", "LOGP"). I tried adding variables like shown; however, the Filter In-DB errored out.
Thanks!
It all depends on the language of the database, but you might try the IN function.
Column 2 IN (“x”,”y”,”z”)
I input the following and received a PARSE_SYNTAX_ERROR. syntax error at or near the end of input. Anything look off with below?
(`COLUMN 1` = "TL" and `COLUMN 2` IN ("LOGI","FLET","LOGN") OR (`COLUMN 1` = "O" and `COLUMN 2` = "DZNA")
You have an extra parenthesis at the beginning.
`COLUMN 1` = "TL" and `COLUMN 2` IN ("LOGI","FLET","LOGN") OR (`COLUMN 1` = "O" and `COLUMN 2` = "DZNA")
THANK YOU!
Happy to help!