Confiforms filter compare two text fields
Asked by fbunting:

In Confiforms, I want to create a filter (in the TableView macro) to show all records where two text fields (**text1** and **text2**) do not match.

I've tried

* **!text1:text2**
* **!text1:\[text2\]**
* **!text1:\[entry.text2\]**

This works when comparing numbers and dates ... but not strings.


Answers:
author: Alex Medved _ConfiForms_
body: The filtering expression would need to be something like this

```
!text1:[entry._func.asEntryRef(entry.text2)]
```

comments: author: fbunting
body: Wow. I never would have found that ... but it works!  

Thanks Alex!


author: fbunting
body: Side note: I notice that this comparison is case-independent. If text1 is **Foobar** , and text2 is **FooBar**, it apparently sees them as the same.


author: Katerina Rudkovskaya [Stiltsoft]
body: Hi [@fbunting](/t5/user/viewprofilepage/user-id/2095486)  

You can [filter rows not equal to selected values](https://docs.stiltsoft.com/display/TFAC/Table+filtration#Tablefiltration-Filteringrowsnotequaltoselectedvalues) with the help of the [Table Filter](https://docs.stiltsoft.com/display/TFAC/How+to+use+Table+Filter+macro?src=contextnavpagetreemode) macro of the [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=cloud&tab=overview) app.  

Wrap your table with [**Table Filter,**](https://docs.stiltsoft.com/display/TFAC/Table+filtration) switch to the **Filters** tab, select the dropdown filter column and add values (text1, text2) to it, then switch to the **Filtration** tab, click **Select reversed filters,** define the filter to operate in the reverse mode.  

![2020-07-30_18h45_01.png](https://community.atlassian.com/t5/image/serverpage/image-id/105007i584FF490BA58D6DB/image-size/large?v=v2&px=999 "2020-07-30_18h45_01.png")  

Best regards,  
Katerina

comments: author: Katerina Rudkovskaya [Stiltsoft]
body: [@fbunting,](https://community.atlassian.com/t5/user/viewprofilepage/user-id/2095486)  

I think I've got what you need, please try our [Table Transformer](https://docs.stiltsoft.com/display/TFAC/How+to+use+Table+Transformer+macro) macro in your case.  

Wrap you rable with it and use the SQL query like this:  

SELECT \* FROM T1  
WHERE T1.'COLUMN 1' \<\> T1.'COLUMN 2'  

![2020-07-30_19h04_23.png](https://community.atlassian.com/t5/image/serverpage/image-id/105011i305EB9814A6490E7/image-size/large?v=v2&px=999 "2020-07-30_19h04_23.png")![2020-07-30_19h04_35.png](https://community.atlassian.com/t5/image/serverpage/image-id/105012iF645E113B046965C/image-size/large?v=v2&px=999 "2020-07-30_19h04_35.png")![2020-07-30_19h04_42.png](https://community.atlassian.com/t5/image/serverpage/image-id/105013i9E8AAF48A3247B9A/image-size/large?v=v2&px=999 "2020-07-30_19h04_42.png")  

Best regards,  
Katerina


author: fbunting
body: Thank you Katerina for your detailed answer! I was about to try the Table Filter macro ... because we have it, and it's great. (I use it constantly.)  

But in this case, I knew there was some magic filter incantation that I could throw right in the Confiforms TableView macro.

But I didn't know about the Table Transformer macro. I'll have to check it out!


Tags: confiforms

confluence-server

server