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] Need to get a unique row from a hold file.
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Need to get a unique row from a hold file.
 Login/Join
 
Master
posted
All,

I have a Guided Ad-Hoc application where the user choose what columns they want to sort the report by and what column they want to print on the report. The data structure is such that we go and get all the data and then only show the actual columns they have selected. If the user were to select all the columns every row would be unique. However if they do not then it looks like there are duplicate records. What I need is to be able to print a distinct row based on the columns they have selected. In a perfect world all I would have to do is
TABLE FILE ????
PRINT DISTINCT &USER_SELECTED_COLUMNS
END

Does anyone know how I could accomplish this?

WebFOCUS 8x
on a report

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




Scott

 
Posts: 864 | Registered: May 24, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Use SUM not PRINT and a BY

TABLE FILE ????
SUM &USER_SELECTED_COLUMNS
BY &USER_SELECTED_COLUMNS NOPRINT
END


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2293 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Master
posted Hide Post
Close but that would only make the vary last column of the print by hidden all the others in the &USER_SELECTED_COLUMNS still be visible. So here is what works.

The print variable has all he columns surrounded by a single quote and have the AND in between each column.

The actual variable that contains all the columns to be printed is &RP_FN01S_Detail1
The actual variable that contains all the columns to be sorted is &RP_FN01B_Sort1

Here is the solution,

 
-SET &OUTLEN = &RP_FN01S_Detail1.LENGTH;
-SET &NEWBYS = STRREP(&RP_FN01S_Detail1.LENGTH, &RP_FN01S_Detail1.QUOTEDSTRING, 7, ''' AND ''', 6, ''' BY ''', &OUTLEN, 'A&OUTLEN.EVAL');
-RUN
TABLE FILE ????
BY  &RP_FN01B_Sort1
BY &NEWBYS 
....


Thanks for your help it pointed me in the right direction.




Scott

 
Posts: 864 | Registered: May 24, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Good.

Do not forget to edit your first post to add [SOLVED] at the subject.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2293 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Need to get a unique row from a hold file.

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.