Focal Point
[SOLVED] Variable number of Decimal Places for groups of rows in one Column

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

October 02, 2008, 12:15 PM
B R Srinivasan
[SOLVED] Variable number of Decimal Places for groups of rows in one Column
Hi,

I have a need of formatting groups of Rows (i.e. for some rows the number of decimal places needs to be 2 decimal places eg. 100.22, for some of the rows it needs to be 1 decimal place eg. 100.2 and for some of the rows without decimal place[B], in one column of a Report.

Example:

Some rows that prints [B]Number of Units
need to be without decimal places.

Example:
Production - Units = 100


Some rows that prints Rates for different types of Products needs 1 decimal place .

Example:
Unit Price: 20.1


Some rows that prints the diffrence between two figures needs 2 decimal places .

Example:
Difference: 20.11

I am trying to arrive at a solution without using ompound report technique.

Please help me with your suggestions.

Thanks in advance.

SRINI

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


WebFOCUS 7.6.4
i5/os
PDF, XL2K, HTML & AHTML
October 02, 2008, 12:27 PM
FrankDutch
Srini

how about this

TABLE FILE WHATEVER
PRINT NUMBER/I10
OVER RATES/D7.1
OVER DIFFRENCE/D12.2
END


But if you post an example of your coding based on the CAR it might help.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

October 02, 2008, 02:26 PM
fthompson
Hey Srini,
We use this technique on several reports. It took me a minute to find the reference in the manual but it's in both of the Creating Reports manuals under Creating Temporary Fields >> Applying Dynamically Formatted Virtual Fields to Report Columns

DEFINE FILE CAR
MYFORMAT/A8=DECODE COUNTRY('ENGLAND' 'P15.2C' 'JAPAN' 'P15.0' ELSE 'P15.2M');
END

TABLE FILE CAR
SUM SALES/MYFORMAT BY COUNTRY
END


Hope that helps.
Fletcher


Production/Test: WF 7.1.4, WIN2K3 Server
October 02, 2008, 04:20 PM
FrankDutch
Fletcher

That is a solution to display the SAME field based on certain selection to be displayed in a different way.

Srini wanted to report 3 different fields row by row. (that's what he said....)




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

October 03, 2008, 01:54 AM
<JG>
Both solutions offer a correct solution dependant on the data source

Franks works based on the data being column oriented

i.e. Sortfield Number_units Rate Difference

Fletchers works based on the data being Row oriented.

i.e. Sortfiled Columntype Columnvalue
October 17, 2008, 08:11 AM
B R Srinivasan
Hi Frank, Fletcher & JG,

I am sorry for my delayed reply as I was working on another assignment till now and I missed to see your replies for my post.

As I cannot use OVER keyword in this report, I adopted FLETCHER's suggestion and used Dynamically formaatted virtual fields for solving the issue.

Many Thanks to all of you for sparing your time in solving the issue I came across.

Srini


WebFOCUS 7.6.4
i5/os
PDF, XL2K, HTML & AHTML