Hi all,
I have an Azure SQL Database with mulitple tables. The "main" table has the following schema:
ID -- int Type -- int
Status -- int Name -- varchar()
I'm wanting to search agains the table and have tried the following formulas:
Case 1
Filter( [TABLE], Type = Combo_1.Selected.ID, Status = Combo_2.Selected.ID )
Case 2
Search( [TABLE], Combo_1.Selected.ID, "Type" )
Has anyone had this issue previously?
Regards,
J
Solved! Go to Solution.
So, in general, your formulas are doing as expected (for the functions you have).
I believe though, if I'm understanding you correctly, that you might want to consider these options:
I'm wanting to search agains the table and have tried the following formulas:Case 1
Filter( [TABLE], Type = Combo_1.Selected.ID, Status = Combo_2.Selected.ID )
CHANGE TO:
Filter( [TABLE], Type = Combo_1.Selected.ID || Status = Combo_2.Selected.ID )
- This means both fields need populating (I may only populate the 1 field and still want it to return values)
Based on your point above, it appears that you want to return results from either field or both. If that is correct, then the above Change formula will provide those results.
When you separate your conditions in the filter as separate parameters as you did in your first formula, the Filter function will AND the conditions. In this case you want OR, so the changed formula provides the OR ( || ) operator to do it.
Case 2
Search( [TABLE], Combo_1.Selected.ID, "Type" )
- This means only a single field can be used
- This doesn't work as a string is expected
The Search function Only works on text fields. In this case you are trying to search an integer column which is not allowed. You can replace the formula with the Change formula (in the previous Case) above to achieve the same results.
I hope this is helpful for you.
Hi @opticshrew2
I think this is the type of syntax you're looking for:
Filter( [TABLE], (IsBlank(Combo_1.Selected.ID) || Type = Combo_1.Selected.ID) && (IsBlank(Combo_2.Selected.ID) || Status = Combo_2.Selected.ID) )
To describe briefly the condition that applies to the Type column, a blank selection for Combo_1 is blank OR (Type = Combo_1.Selected.ID) will resolve to true. This is the logic that enables us to conditionally filter by a combobox value. Hopefully, that makes sense, but post back if it doesn't.
So, in general, your formulas are doing as expected (for the functions you have).
I believe though, if I'm understanding you correctly, that you might want to consider these options:
I'm wanting to search agains the table and have tried the following formulas:Case 1
Filter( [TABLE], Type = Combo_1.Selected.ID, Status = Combo_2.Selected.ID )
CHANGE TO:
Filter( [TABLE], Type = Combo_1.Selected.ID || Status = Combo_2.Selected.ID )
- This means both fields need populating (I may only populate the 1 field and still want it to return values)
Based on your point above, it appears that you want to return results from either field or both. If that is correct, then the above Change formula will provide those results.
When you separate your conditions in the filter as separate parameters as you did in your first formula, the Filter function will AND the conditions. In this case you want OR, so the changed formula provides the OR ( || ) operator to do it.
Case 2
Search( [TABLE], Combo_1.Selected.ID, "Type" )
- This means only a single field can be used
- This doesn't work as a string is expected
The Search function Only works on text fields. In this case you are trying to search an integer column which is not allowed. You can replace the formula with the Change formula (in the previous Case) above to achieve the same results.
I hope this is helpful for you.
User | Count |
---|---|
195 | |
125 | |
88 | |
48 | |
42 |
User | Count |
---|---|
280 | |
164 | |
138 | |
81 | |
76 |