Skip to main content
16-Pearl
Dec 19, 2024 2:07 PM UTC
Solved

Return top X results from Query Builder report

Version: Windchill 13.0

 

Use Case: I have a query that can return thousands of results but only need to see the first 10 to 20 based on sort order.


Description:

I can return the top 10 results in TSQL with:
SELECT TOP 10 {column} ... ORDER BY {column} DESC
Can we do this with Query Builder?

avillanueva
23-Emerald II
Dec 19, 2024 3:00 PM UTC

3 replies

avillanueva
23-Emerald II
Dec 19, 2024 3:00 PM UTC
avillanueva
23-Emerald II
Dec 20, 2024 2:02 PM UTC

Hmm, if we had the ability to display the row number, it would be possible to put a condition that shows row numbers less than a value. ROW_NUMBER() or ROWNUM is a function but not one that is listed. I tried using it as a constant and it did not like it. No way to trick it to reading it like pure sql. 

Translate
20-Turquoise
Dec 19, 2024 11:04 PM UTC

You might be able to use a custom java class for this:

https://www.ptc.com/en/support/article/CS114482

Translate