Skip to main content
Question

Classification

  • April 3, 2025
  • 3 replies
  • 68 views

Saba
Level 7
Forum|alt.badge.img

Hello everyone,
I have a coloumn with a lot of numbers and as an example i have uploaded a screenshot of it.


I wanted to classify them into groups so i wrote a case when like this :

CASE

        WHEN KPI("max_potential_saving") BETWEEN 7000 AND 70000  THEN 1  

        WHEN KPI("max_potential_saving") BETWEEN 1000 AND 7000  THEN 2      

        WHEN KPI("max_potential_saving") BETWEEN 800 AND 1000  THEN 3    

        WHEN KPI("max_potential_saving") BETWEEN  600 AND  800 THEN 4  

        WHEN KPI("max_potential_saving") BETWEEN  400 AND  600 THEN 5

        WHEN KPI("max_potential_saving") BETWEEN  200 AND  400 THEN 6

        WHEN KPI("max_potential_saving") BETWEEN  0 AND 200  THEN 7

        ELSE 8  

    END
but when i sort it based on the classification it does not show the Max Potential Saving in order from highest to lowest. Does anyone have an idea ?
 

Thanks in advance !

3 replies

Julie Shih
Celonaut
  • Celonaut
  • April 3, 2025

Hi Saba, you can apply sorting to the Max Potential Saving column by clicking on the column name. Clicking on it again reverses the sort order (indicated by the direction of the arrow). The table allows for sorting on multiple columns, so you can first have it sort on the criteria from one column, then the other.

 


Saba
Level 7
Forum|alt.badge.img
  • Author
  • Level 7
  • April 4, 2025

Hi Julie,
First of all thanks for your reply, but i do not mean manually.

Is there any way to do that in PQL?


Julie Shih
Celonaut
  • Celonaut
  • April 4, 2025

Oh, I see. PQL is not like SQL and does not have the ability to sort. You can use column sorting to achieve similar results.