Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Trouble with getting distinct value list with row counts

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Trouble with getting distinct value list with row counts
 Login/Join
 
Silver Member
posted
Hi,

Trying to do a distinct on a table field to receive the distinct values then add a row counter to each, (to be used for iteration). I've tried a few different routes to do this but the latest through the UI is here:

TABLE FILE TMP
SUM
COMPUTE ROWCNT/I9 = LAST ROWCNT + 1;
PRINT
DST.GUID
END

This gives me a distinct list of GUIDs but only the first row has a ROWCNT. Thoughts?

Thanks!

This message has been edited. Last edited by: FP Mod Chuck,


Windows 8203 All output formats
 
Posts: 47 | Registered: November 30, 2018Report This Post
Expert
posted Hide Post
Sorting it by GUI will give you distinct values, so
TABLE FILE TMP
SUM COMPUTE ROWCNT/I9 = LAST ROWCNT + 1;
BY GUID
END


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
Or

TABLE FILE TMP
RANKED BY GUID
END


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
 
Posts: 454 | Location: Europe | Registered: February 05, 2007Report This Post
Silver Member
posted Hide Post
Worked, thanks!


Windows 8203 All output formats
 
Posts: 47 | Registered: November 30, 2018Report This Post
Silver Member
posted Hide Post
Follow up: I went the ranked route.

W.r.t. the 'BY' route though, I thought 'BY' is used for sorting, why would it result in a distinct in this case?

Thanks!


Windows 8203 All output formats
 
Posts: 47 | Registered: November 30, 2018Report This Post
Guru
posted Hide Post
BY is for sorting and grouping. So in this case the most important thing is to group on GUID.

For the database group by or distinct is the same thing in terms of results.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
 
Posts: 454 | Location: Europe | Registered: February 05, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Trouble with getting distinct value list with row counts

Copyright © 1996-2020 Information Builders