Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
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
Go
New
Search
Notify
Tools
Reply
  
[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, 2018Reply With QuoteReport 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.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5575 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport 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: 381 | Location: Europe | Registered: February 05, 2007Reply With QuoteReport This Post
Silver Member
posted Hide Post
Worked, thanks!


Windows 8203 All output formats
 
Posts: 47 | Registered: November 30, 2018Reply With QuoteReport 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, 2018Reply With QuoteReport 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: 381 | Location: Europe | Registered: February 05, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

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-2018 Information Builders, leaders in enterprise business intelligence.