How to use if condition in the aggregate filter

How to use if condition in the aggregate filter

I have a simple program where we have a list of records with columns like employees, DOB, city, country, phone number.  To filter this data on the basis of country or phone or city, i have created a combobox to select the search field and a text box to enter the search text. E.g. Combox has 3 values - Country, City and Phone. If i select city and enter search text as "New York", the recordlist should list all employees whose belon to the city "New York". The following code is not getting accepted as a filter condition. It says it "Invalid use of 'Boolean' in Filter.

If(varFilterCombo=1, Employees.Country like "%" + varSearchText + "%",
If(varFilterCombo=2, Employees.City like "%" + varSearchText + "%",
Employees.Phone like "%" + varSearchText + "%"))

Also, if i remove the if condition and only use one condition, it works fine. E.g. Employees.Country like "%" + varSearchText + "%"

Please let me know how to use the if condition in the aggregate filter.

You have to think in SQL.

(varFilterCombo=1 AND Employees.Country like "%" + varSearchText + "%")
(varFilterCombo=2 AND Employees.City like "%" + varSearchText + "%")
(varFilterCombo=2 AND Employees.Phone like "%" + varSearchText + "%")

Thanks Nuno. The filter worked but earlier i was getting all records by default. Now by default the grid is blank. Once i apply the filter and hit on search, the results appear as per the filter applied.