Skip to main content

Hey People,

I need help sorting a coloumn in a table where each item number appears twice with a corresponding "Potential Savings" value. My goal is to sort the "Potential Savings" coloumn in descending order while keeping duplicate Item Numbers together (as shown in the current table). However, when I try to sort "Potential Savings," the duplicate entries get separated.

Does anyone know how to sort the table in a way that maintains both the descending order of "Potential Savings" and keeps the duplicate items next to each other?

Thanks in advance!

 

Vendor Name Business Unit Item Number Commodity Last Order Date Expected Delivery Days Unit Price Potential Savings
Alpha Supplies P18 0410390025 I030 2004-01-29 27 10.45 52.66
Beta Industries P20 0410390025 I030 2004-02-09 0 6.90 0.00
Alpha Supplies P18 0437150201 A110 2004-07-31 40 40.67 69.35
Gamma Solutions P20 0437150201 A110 2004-08-26 50 32.00 0.00
Alpha Supplies P18 0600930207 C130 2004-08-27 26 0.06 1.44
Delta Engineering P20 0600930207 C130 2004-09-30 17 0.02 30.60
Alpha Supplies P18 0602831110 C130 2004-06-03 28 0.06 0.54
Omega Corp P20 0602831110 C130 2004-12-16 30 0.04 0.00
Alpha Supplies P18 0602831114 C130 2004-06-03 29 0.01 0.00
Omega Corp P20 0602831114 C130 2004-09-17 20 0.05 9.81

 

In my Oppionion, this isnt possible without any complex SQL or PQL Coding. 

 

What could be possible is to create an costum SQL Table with a code logik that maps every Number to the highest possible saving, then sort by Saving and then Afterwarts, puts then dupplicate Number behind the first occurence of the Number. Just Ask Chat GPT it should be capable to do such thing


I created a column with 'PU Max', which finds the maximum value for each number and writes it for both. For example, for 0410390025, we have P18 with a value of 52.66 and P20 with a value of 0. For both, it writes 52.66.

 


Reply