Table Transformer Macro SQL CASE statement not sorting correctly - help please!

Amy Sliwinski February 28, 2025

Hello, 

 

I am trying to sort a table by two columns. First, in ascending order by the "Tentative Timeline" column and, second, in descending order by "Priority Level." 

We are using the status macro for the values in the "Priority Level" column, but I have adjusted the query to only ORDER BY "Priority Level" and that by itself worked, so there are not issues with the macro recognizing the values. The issue seems to be with the CASE statement, but I have tried slight adjustments multiple times and simply cannot figure it out. Can anyone help me figure out what I am doing wrong? 

 

SELECT * FROM T*
ORDER BY 'Tentative Timeline' ASC,
CASE
WHEN ('Priority Level' = 'High') THEN 1
WHEN ('Priority Level' = 'Medium') THEN 2
WHEN ('Priority Level' = 'Low') THEN 3
ELSE 4
END DESC;

 

 

Screenshot 2025-02-28 at 9.30.08 AM.pngScreenshot 2025-02-28 at 9.31.39 AM.png

1 answer

0 votes
Amy Sliwinski February 28, 2025

My team helped me figure it out! The "Priority Level" values are case sensitive! We changed it to "HIGH" for example and it WORKED!! Yay!

Michael Wohlgemuth (Wolge)
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.
February 28, 2025

Shoutout to your awesome team at this point! :D 

Like Amy Sliwinski likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events