Hi all!
I manage a program that uses tickets. My page currently has full data table displaying information about all tickets in the program with a pivot table that summarizes all tickets by status. The Table Filter macro will filter both pivot table and data table.
I would like to sort the pivot in an order defined by me rather than alphabetically. I tried to use Table Transformer with SQL query that does this (WHEN T1.'Status' LIKE "Escalation Review" THEN "1"...) but I think the Table Transformer is attempting to sort the data table and not the pivot table.
Is there a way for me to use Table Transformer to apply only to pivot table? Or another macro to use?
Hello @Kelsey Lubbe
Please try this SQL query:
SELECT *
FROM T*
ORDER BY
CASE
WHEN T1.'Status' LIKE "Escalation Review" THEN 1
WHEN T1.'Status' LIKE "Root Cause Analysis" THEN 2
WHEN T1.'Status' LIKE "Corrective Action Plan" THEN 3
WHEN T1.'Status' LIKE "Pending Approval" THEN 4
ELSE 5
END
Katerina
Stiltsoft
Thanks, @Katerina Rudkovskaya _Stiltsoft_ . This is similar to the output I got previously. Screenshot here compared to output without Table Transformer.
No Table Transformer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kelsey Lubbe ,
Note that in your case, you can change the order of columns just choosing them with the help of autocompletion in Table Transformer according to your needs.
Please see my exampe below:
Use autocompletion: start typing, e.g., T1. and choose the column.
Katerina
Stiltsoft
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Katerina,
Thank you! That did sort the top pivot table in the appropriate order.
Is it expected that the full data table (from Table from CSV in original screenshot) is hidden? The reason why I have the Pivot Table and data table nested inside the Table Transformer macro is because I want the Table Filter macro to apply to both Pivot Table and data table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kelsey Lubbe,
You can set it to show or hide the source table in both Pivot Table and Table Transformer macros.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh my, I was expecting a checkbox to display/hide and did not expect a dropdown option. My bad on missing that! Thanks so much for the help @Andrey Khaneev _StiltSoft_ @Katerina Rudkovskaya _Stiltsoft_ !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andrey Khaneev _StiltSoft_ I think I discovered an issue that simply needs some error handling. It looks like if any of the defined columns does not have a task of that status (meaning count 0), it throws an error and the whole table will not display:
Error: Column does not exist: Count STATUSNAME
Does anyone have a recommendation on how to handle that scenario? I have removed the column with a 0 count and the table displays correctly again. However, we would like to display that column count when it does have tasks in that status...
Thanks so much, the above info has been great in getting us this far!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sean M, please try to use COALESCE function in this case:
COALESCE(T1.'Count STATUSNAME')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Katerina Rudkovskaya _Stiltsoft_ Thanks for the answer above. It definitely solved for my similar column sorting challenge.
I am using this solution to show Status Counts across a number of work efforts.
Each Pivot Table is pulling Status Counts from a specific JQL statement from Jira Macro.
SELECT T1.'Assignee',
T1.'Count Open',
T1.'Count In Progress',
T1.'Count On Hold',
T1.'Count Resolved',
T1.'Count Closed',
T1.'Count',
T1.*
FROM T*
When a JQL return does find any cards in Resolved Status, the Transformer SQL tells me so with Error: Column does not exist: Count Resolved
--> Is there a way I can sort all columns for Status, regardless of a card being in that status?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Randall Hinds ,
Isn't the Sean's question from Sep 21, 2021 similar to your case?
Please check the two comments right above yours: the question by Sean and the answer by Andrey about the COALESCE function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, @Stiltsoft support ! That function does let me arrange Status columns even when there are no cards to count in a particular Status.
However, the header row shows the COALESCE function statement & adds so much empty space in the table.
Even though the SELECT function lets me reorder Status where there are cards to Count, it is less visually appealing than simply letting a Pivot Table sort Status alphabetically.
Table Transformer example with SELECT function wrapper on Pivot
example with only Pivot Table
I want to reorder columns showing the colored names even when there are no cards in a particular Status... It seems I can do all of these things, but I can't figure out how to do them at once.
Is there a way I can have my cake & eat it too?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Randall Hinds ,
Seems that you've forgot to rename your columns:
COALESCE(T1.'Col 1') AS 'Col 1' (the same goes for every column)
For your case it may be very neat, cause you may get rid of the "Count" prefix:
COALESCE(T1.'Count Open') AS 'Open'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's like magic! You guys rock me!
SELECT T1.'Assignee',
COALESCE(T1.'Count Open') AS 'Open',
COALESCE(T1.'Count Defined') AS 'Defined',
COALESCE(T1.'Count In Progress') AS 'In Progress',
COALESCE(T1.'Count On Hold') AS 'On Hold',
COALESCE(T1.'Count Resolved') AS 'Resolved',
COALESCE(T1.'Count Closed') AS 'Closed',
COALESCE(T1.'Count') AS 'Total'
FROM T*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I discovered an issue that simply needs some error handling. It looks like if any of the defined columns does not have a task of that status (meaning count 0), it throws an error and the whole table will not display:
Error: Column does not exist: Count STATUSNAME
Does anyone have a recommendation on how to handle that scenario? I have removed the column with a 0 count and the table displays correctly again. However, we would like to display that column count when it does have tasks in that status...
Thanks so much, the above info has been great in getting us this far!
Added to reply section. Please disregard this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.