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.

New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.

What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.

During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     SOLVED - How to show Distinct values in guided adhoc results?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
SOLVED - How to show Distinct values in guided adhoc results?
 Login/Join
 
Member
posted
I have a guided ad-hoc report, which is build on several views joined together.
Depending on how many fields are selected to be displayed I am getting duplicate rows in the output report.
Is there a way to specify to return only distinct values in the guided ad-hoc report?
This is the sample code of the report, which includes 1 sort section and 4 details sections:
( ... more fields here - is not actually in the report but to make a point it is just subset of fields selected)

TABLE FILE VF_APP_SEQ_EVENT_ADHOC
PRINT
&RP_FN09P_Detail9.(AND( ... more fields here).Please select detail field(s).
&RP_FN14P_Detail14.(AND() ... more fields here).Please select detail field(s).
&RP_FN41P_Detail41.(AND() ... more fields here).Please select detail field(s).
&RP_FN62P_Detail62.(AND() ... more fields here).Please select detail field(s).
BY LOWEST &RP_FN01B_Sort1.(BY() ... more fields here).Please select sort field(s).
ON TABLE SET ONFIELD IGNORE
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON

The WebFocus generated SLQ statement is as follows:
SELECT
T1."APP_COUNTRY_ID",
T1."PRODUCT_FAMILY_ID",
... more fields here
T19."NAME",
FROM
( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( vf_app_seq_event T1
INNER JOIN DM.VF_CTXT_APP_PRODUCT T3
ON (T3."APPLICATION_ID" = T1."APPLICATION_ID") )
LEFT OUTER JOIN DM.VD_PRODUCT T4
ON T4."PRODUCT_ID" = T3."PRODUCT_ID" )
INNER JOIN DM.VF_CTXT_APP_COUNTRY T6
ON (T6."APPLICATION_ID" = T1."APPLICATION_ID") )
LEFT OUTER JOIN DM.VD_COUNTRY T7
ON T7."COUNTRY_ID" = T6."COUNTRY_ID" )
LEFT OUTER JOIN DM.VD_COUNTRY T8
ON T8."COUNTRY_ID" = T1."SEQ_COUNTRY_ID" )
LEFT OUTER JOIN DM.VD_EVENT_COUNTRY T9
ON T9."EVENT_COUNTRY_ID" = T1."EVENT_COUNTRY_ID" )
LEFT OUTER JOIN DM.VD_COUNTRY T10
ON T10."COUNTRY_ID" = T9."EVENT_COUNTRY_ID" )
LEFT OUTER JOIN DM.VD_EVENT T11
ON T11."EVENT_ID" = T1."EVENT_ID" )
LEFT OUTER JOIN DM.VF_COMMENT T12
ON T12."ASSOCIATED_ENTITY_ID" = T11."EVENT_ID" )
LEFT OUTER JOIN DM.VF_PRODUCT_EVENT T13
ON T13."EVENT_ID" = T11."EVENT_ID" )
LEFT OUTER JOIN DM.VD_PRODUCT T14
ON T14."PRODUCT_ID" = T13."PRODUCT_ID" )
LEFT OUTER JOIN DM.VD_SEQUENCE T15
ON T15."SEQUENCE_ID" = T1."SEQUENCE_ID" )
LEFT OUTER JOIN DM.VF_COMMENT T16
ON T16."ASSOCIATED_ENTITY_ID" = T15."SEQUENCE_ID" )
LEFT OUTER JOIN DM.VD_APPLICATION T17
ON T17."APPLICATION_ID" = T1."APPLICATION_ID" )
LEFT OUTER JOIN DM.VF_COMMENT T18
ON T18."ASSOCIATED_ENTITY_ID" = T17."APPLICATION_ID" )
LEFT OUTER JOIN DM.VD_PRODUCT_FAMILY T19
ON T19."PRODUCT_FAMILY_ID" = T1."PRODUCT_FAMILY_ID" )
LEFT OUTER JOIN DM.VD_APP_COUNTRY T20
ON T20."APP_COUNTRY_ID" = T1."APP_COUNTRY_ID" )
ORDER BY
T19."NAME",
T17."IDENTIFICATION_CODE",
T17."NAME",
T15."NAME",
T15."IDENTIFICATION_CODE",
T11."IDENTIFICATION_CODE",
T11."NAME",
T7."NAME";


Is there a way to specify either in the report or join to bring only distinct values, so the generated SQL contains: select distinct?

This message has been edited. Last edited by: ElizabethN,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 13 | Registered: September 15, 2014Report This Post
Virtuoso
posted Hide Post
You are doing a "detail" report (PRINT) so it will give you every single row that matches your filtering criteria.

Getting more or less records depending on the fields actually chosen when running the request is probably due to your 20 joins there. One or more of them is causing your data to be duplicated which may or may not be a correct scenario for you.

One way to get rid of duplicates is to switch your report into a summary one (SUM) and moving the selected fields down to the BY section, but I would actually look into your data and joins first!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report 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 - How to show Distinct values in guided adhoc results?

Copyright © 1996-2020 Information Builders