Table Transformer - how do you get the WHERE x IN function to work?
Asked by Craig Buchanan:

I am trying to get the WHERE x IN function to work with no luck in the table transformer so would love some help in getting this to work where multiple conditions are required

Example:

Table 1

![Table.PNG](/t5/image/serverpage/image-id/132526i9F3F8ECEC158A62C/image-size/large?v=v2&px=999 "Table.PNG")

Table 2

![Table 2.PNG](/t5/image/serverpage/image-id/132527i481E0DB3CC371E7C/image-size/large?v=v2&px=999 "Table 2.PNG")

SQL Query

SELECT  
T2.'Name',  
T2.'Team ref',  
T2.'Location',  
T2.'Allocation',  
NC.'Public Holidays',  
T2.'Annual Leave'  
FROM  
(SELECT 'Location', COUNT('Location') AS 'Public Holidays' FROM T1 GROUP BY T1.'Location') NC  
LEFT JOIN T2  
ON T2.'Location'=NC.'Location'  
WHERE 'Team ref' IN ("Apple", "Common")

Results in:

![Capture.PNG](/t5/image/serverpage/image-id/132528i912AAC03A0DD2512/image-size/large?v=v2&px=999 "Capture.PNG")

I have also tried changing the WHERE statement to be:

WHERE 'Team ref' IN ('Apple', 'Common')

With the same result


Answers:
author: Katerina Kovriga {Stiltsoft}
body: Hi [@Craig Buchanan](/t5/user/viewprofilepage/user-id/4052131) ,

Please clarify which hosting do you use - Cloud or Server/DC (and the app version for the latter).

I've checked your query both on the Cloud version and the up-to-date Server version and everything seems to work fine:

![Tue 3-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/132559iCD29F1FC8B515E41/image-size/large?v=v2&px=999 "Tue 3-1.png")

I've copied your query without any changes:

![Tue 3-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/132560i90946A70324EBE54/image-size/large?v=v2&px=999 "Tue 3-2.png")

![Tue 3-3.png](https://community.atlassian.com/t5/image/serverpage/image-id/132561i8C0C5121123F4073/image-size/large?v=v2&px=999 "Tue 3-3.png")

If you use the advanced cells formatting, you'll be able to [align](https://docs.stiltsoft.com/display/public/TFAC/Advanced+table+cells+formatting#Advancedtablecellsformatting-Changingalignment) the Public Holidays column text to the left as well:

SELECT  
T2.'Name',  
T2.'Team ref',  
T2.'Location',  
T2.'Allocation',  
**FORMATWIKI("{cell:align=left}" + NC.'Public Holidays' + "{cell}") AS 'Public Holidays',**   
T2.'Annual Leave'  
FROM  
(SELECT 'Location', COUNT('Location') AS 'Public Holidays' FROM T1 GROUP BY T1.'Location') NC  
LEFT JOIN T2  
ON T2.'Location'=NC.'Location'  
WHERE 'Team ref' IN ("Apple", "Common")

![Tue 3-4.png](https://community.atlassian.com/t5/image/serverpage/image-id/132562i62025FCCF3242146/image-size/large?v=v2&px=999 "Tue 3-4.png")

So, you may also try to recreate you tables on another Confluence page and wrap them into a fresh Table Transformer macro - maybe it's kind of a temporary bug related to some cache or smth.

comments: author: Craig Buchanan
body: [@Katerina Kovriga {Stiltsoft}](/t5/user/viewprofilepage/user-id/1464746) I have tried again in a new confluence page and even in a new space and still the same issue.

We are using server and version is **Table Filter and Charts for Confluence plugin and version is 6.3.1**


author: Katerina Kovriga {Stiltsoft}
body: Hi [@Craig Buchanan](/t5/user/viewprofilepage/user-id/4052131) ,

I've consulted the developers team and they strongly recommend to update the app to make the query work (it should work from the 6.3.8 version).

The current version is **7.1.9**.

Besides from the 7.0.0 version you'll be able to use Smart Charts Insertion in the page view mode.