Focal Point
[SOLVED] help with counts

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

May 18, 2012, 07:46 PM
cfish
[SOLVED] help with counts
i want to get output like this....

Product Count
ProdA 1
ProdA 2
ProdA 3
ProdA 4
ProdB 1
ProdB 2
ProdB 3
ProdC 1
ProdC 2
ProdC 3
ProdC 4
ProdC 5

I'd appreciate any help...thanks!

This message has been edited. Last edited by: Kerry,
May 19, 2012, 09:17 AM
Rao D
How is your data stored ? May be you need to provide more details? Is product the detail level of information.


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

May 19, 2012, 10:52 AM
George Patton
Assuming you first sort the data BY PRODUCT, and hold it AS YOURFILE then the following will number them as you wish:

DEFINE FILE YOURFILE
PRODCOUNT/I4=IF PRODUCT EQ LAST PRODUCT THEN PRODCOUNT + 1 ELSE 1;
END

TABLE FILE YOURFILE
PRINT PRODCOUNT 
BY PRODUCT
END



WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
May 19, 2012, 07:35 PM
cfish
Worked perfectly!

I was hoping it was easy and it was!

Thanks for your help!
May 20, 2012, 04:16 PM
Waz
You could also use LIST, but this depends on the data

TABLE FILE {table}
LIST {field}
BY PRODUCT
END


When asking for help like this, more infor helps us.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

May 20, 2012, 06:03 PM
cfish
you are correct...i should have provided more information on this....I appreciate everyone's willingness to help

thanks again
May 21, 2012, 09:30 AM
George Patton
I also thought about LIST and also RANKED, but both of those would put the numbers to the left of the product, not to the right, which was the original request.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
May 21, 2012, 09:37 AM
cfish
i'll keep those in mind...it didn't matter which side the numbers appeared..i had on the right as an example.

thanks again.
May 21, 2012, 09:51 AM
Doug
RANK BY Filed?