Focal Point
[SOLVED] Total Item Count displayed on each duplicate row

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9567089096

December 17, 2018, 10:48 AM
Jveselka
[SOLVED] Total Item Count displayed on each duplicate row
WF 8105
I need a report that will show the total number of an item for each item type in is own column. Not easy to put into words....lolz

This is also needed in a WHERE because they only want to see this when there are 4 or more claims on one policy.
EXAMPLE

One policy could have 5 different claims on it. They want the report to look like this.

Policy Number | Claim Number | Claim Count
123456 0001 5
123456 0002 5
123456 0003 5
123456 0004 5
123456 0005 5

Thanks
JV
WF 8105

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


WebFOCUS 8105m
Windows, All Outputs
December 17, 2018, 11:24 AM
Tony A
Something like
TABLE FILE GGSALES
COUNT
     GGSALES.SALES01.DOLLARS WITHIN REPORT
     GGSALES.SALES01.DOLLARS WITHIN REGION
     GGSALES.SALES01.DOLLARS WITHIN ST
BY  GGSALES.SALES01.REGION
BY  LOWEST GGSALES.SALES01.ST
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = warm,
$
ENDSTYLE
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 
December 17, 2018, 12:00 PM
Jveselka
Yes, but there are other fields that need to print also.

Thanks
JV


WebFOCUS 8105m
Windows, All Outputs
December 17, 2018, 12:02 PM
Tony A
That may be, but this gives you some code that you might be able to incorporate.

The verb doesn't have to be COUNT, it could easily be SUM, PRINT, WRITE etc.

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 
December 17, 2018, 01:15 PM
MartinY
Or you can have your claim count per policy hold in a file that will then be JOINed to the more detailed file (Policy/Claim file) where the join is made on Policy#.
That way the same claim count will be repeated to each matching Policy#

Many ways to have what you're looking for


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
December 18, 2018, 05:03 AM
Frans
Or you can use PARTITION_AGGR:

TABLE FILE CAR
SUM SALES
COMPUTE CNT/I5 = PARTITION_AGGR(SALES, COUNTRY, B, E, CNT);
BY COUNTRY
BY CAR
END


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
December 18, 2018, 06:52 AM
Tony A
Good call Frans, but I don't think that was available in 8.1.05?

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 
December 18, 2018, 10:49 AM
Frans
You're right Tony, overlooked that, it's only in 82xx Versions.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
December 18, 2018, 03:45 PM
Jveselka
Thanks to all.

If I don't use COUNT as the Verb it does not seem to work right. Looks like the hold file will work.

As for the PARTITION_AGGR function, looks like another reason to get our upgrade done. We hope to move to 8203 in January 2019.

Thanks again
JV


WebFOCUS 8105m
Windows, All Outputs
December 19, 2018, 12:41 PM
Tony A
If you use SUM then use a prefix operator on the field such as CNT.fieldname.

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 
December 20, 2018, 04:54 AM
Tony A
Just in case you do not understand, here's a little Seasonal Present for you.

The first parts just create sample data from what you posted.

EX -LINES * EDAPUT MASTER,jv,CV,MEM
FILENAME=jv,SUFFIX=FOC,$
SEGNAME=jv,SEGTYPE=,$
FIELD=POLICYNO,,I11,TITLE='Policy Number',$ 
FIELD=CLAIMNO,,I11,TITLE='Claim Number',$ 
EDAPUT*

CREATE FILE jv
 
MODIFY FILE jv
FREEFORM POLICYNO CLAIMNO
DATA
123456,1,$
123456,2,$
123456,3,$
123456,4,$
123456,5,$
223456,1,$
223456,2,$
223456,3,$
END

TABLE FILE jv
SUM CNT.CLAIMNO WITHIN POLICY AS 'Count'
BY POLICYNO SUBFOOT ""
BY CLAIMNO
ON TABLE SET BYDISPLAY ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
grid=off,$
ENDSTYLE
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