Focal Point
[SOLVED] Number of Cars by Sales Ranges

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

December 12, 2017, 05:24 PM
Joel Elscott
[SOLVED] Number of Cars by Sales Ranges
Hopefully this is a simple question with solution! How can I build this report using the CAR file? Other than building 4 hold files and merging them together, I can't figure out how to do this! Thanks in advance!

Sales Category # of Cars
Less than $5K 6
5K - 10K 2
10K - 30K 3
Over 30K 2

EDIT: I can't get the above table to format correctly on here. It's just a two column report, column 1 is Sales Category, column 2 is # of Cars.

This message has been edited. Last edited by: Joel Elscott,


WebFOCUS 8.2.03
z/OS
December 12, 2017, 05:34 PM
Waz
Check out BY LOWER n PLUS OTHERS IN-GROUPS-OF


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!

December 12, 2017, 05:45 PM
Pku
This is something that I learned from the previous webminar.

TABLE FILE CAR
SUM CNT.CAR
BY SALES AS 'RANGE' ROWS 0 TO 5000 AS '0 TO 5K' OVER 5000 TO 10000 AS '5K - 10K' OVER 10000 TO 30000 AS '10K - 30K' OVER 3000 TO 100000 AS 'Over 30K'
END 



Thanks,
Pku

Focus, WebFocus 8201 on Windows
December 13, 2017, 01:31 AM
Chaudhary
Try this ,

TABLE FILE CAR
SUM 
     CNT.CAR.COMP.CAR AS '# of Cars'
BY  CAR.BODY.SALES AS 'Sales Category' IN-RANGES-OF 5001 TOP 30000
ON TABLE NOTOTAL
END

 


OR
 TABLE FILE CAR
SUM
     CNT.CAR.COMP.CAR AS '# of Cars'
 
FOR  CAR.BODY.SALES  AS 'Sales Category'
0 TO 5000 AS '0 - 5K' OVER
 5000 TO 10000 AS '5K - 10K' OVER 
10000 TO 30000 AS '10K - 30K' OVER
 3000 TO 90000   AS 'Over 30K'
END
ON TABLE NOTOTAL
END
 
 

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


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
December 13, 2017, 04:16 AM
Danny-SRL
And this:
  
DEFINE FILE CAR
SALERANGE/I2=IF SALES LT 5000 THEN 1 ELSE
             IF SALES LT 10000 THEN 2 ELSE
             IF SALES LT 30000 THEN 3 ELSE 4;
SALERANGEDISPLAY/A12=DECODE SALERANGE(
1 'Less than 5K'
2 '5K - 10K'
3 '10K - 30K'
4 'Over 30K');
END
TABLE FILE CAR
SUM CNT.CAR AS '# of Cars'
BY SALERANGE NOPRINT
BY SALERANGEDISPLAY AS 'Sales Category'
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

December 13, 2017, 09:36 AM
Joel Elscott
Pku, Chaudhary and Danny - Brilliant solutions, thank you so much for your time and assistance. Much appreciated! This forum never ceases to amaze me.

Tags
Ranges
Account Values Ranges
Banded Ranges
Sales Range
Decode
Count
.CNT

This message has been edited. Last edited by: Joel Elscott,


WebFOCUS 8.2.03
z/OS