Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Table Transformer - how do you get the WHERE x IN function to work?

Craig Buchanan March 2, 2021

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

Table 2

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

I have also tried changing the WHERE statement to be:

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

With the same result

1 answer

1 vote
Katerina Kovriga _Stiltsoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 2, 2021

Hi @Craig Buchanan ,

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

I've copied your query without any changes:

Tue 3-2.png

Tue 3-3.png

 

If you use the advanced cells formatting, you'll be able to align 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

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.

Craig Buchanan March 2, 2021

@Katerina Kovriga _Stiltsoft_  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

Katerina Kovriga _Stiltsoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 2, 2021

Hi @Craig Buchanan ,

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events