This is how the data is for an year. For reference number with multiple product_Id i need to display only product_Id details with lowest Priority-Id. I have to use this data as a HOLD file for rest of the report logic.
Please give some suggestions.This message has been edited. Last edited by: FP Mod Chuck,
WF8206,Windows 7,8,10 HTM,PDF,EXCEL
May 31, 2018, 02:32 AM
Danny-SRL
Using the data you show: for Ref_no 17008132 you want to show only Product_Id 23007 because its Priority_Id is 6? And all Sale Count?
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
May 31, 2018, 05:30 AM
Wep5622
Sounds like you need:
BY LOWEST 1 Priority_Id
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
May 31, 2018, 06:59 AM
Chaudhary
Hi srajeevan, I took below sample data and created a master file called Prod_Ref
TABLE FILE PROD_REF
SUM
MIN.PRIORITY_ID WITHIN PROD_REF.PROD_REF.REF_NO AS 'MIN'
BY PROD_REF.PROD_REF.REF_NO
BY PROD_REF.PROD_REF.PRODUCT_ID
BY PROD_REF.PROD_REF.PRIORITY_ID
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS MIN
END
DEFINE FILE MIN
FLAG/A2 = IF(PRIORITY_ID EQ MIN) THEN 'Y' ELSE 'N';
END
TABLE FILE MIN
PRINT
FLAG
BY REF_NO
BY PRODUCT_ID
BY PRIORITY_ID
WHERE FLAG EQ 'Y'
END
Report output:-
REF_NO PRODUCT_ID PRIORITY_ID FLAG
17003014 13001 11 Y
17003278 35001 19 Y
17003332 50000 27 Y
17003679 50000 27 Y
17004196 26001 13 Y
17004971 23007 6 Y
17008132 23007 6 Y
Originally posted by Danny-SRL: Using the data you show: for Ref_no 17008132 you want to show only Product_Id 23007 because its Priority_Id is 6? And all Sale Count?
Yes @Danny-SRL.I want to show only Product_Id 23007 with its Sale Count.
WF8206,Windows 7,8,10 HTM,PDF,EXCEL
May 31, 2018, 08:47 AM
srajeevan
quote:
Originally posted by Wep5622: Sounds like you need:
BY LOWEST 1 Priority_Id
@Wep5622..
BY LOWEST 1 Priority_Id
wont work because Priority_Id is sorting based on Product_Id. Ex: for Ref_no 17008132 two Product_Id are there..so When i give
BY LOWEST 1 Priority_Id
,for the Product_Id 13001 lowest is 11 itself and for 23007 lowest priority_id id 6..so both will display.
WF8206,Windows 7,8,10 HTM,PDF,EXCEL
May 31, 2018, 08:59 AM
srajeevan
@Chaudhary.
You solution is working for me. Thanks. Saved my day.
WF8206,Windows 7,8,10 HTM,PDF,EXCEL
May 31, 2018, 09:04 AM
Chaudhary
quote:
You solution is working for me. Thanks. Saved my day.