Focal Point
[SOLVED] subtotal on an alphanumeric field

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

September 16, 2011, 04:12 PM
sumant
[SOLVED] subtotal on an alphanumeric field
Hello,

I have an alphanumeric field which is A20. The field only has numbers.
I want to subtotal on the alphanumeric field.
When I try to convert the alphanumeric to decimal using ATODBL, the maximum limit is 15 which is not serving my purpose.
I have set SET SUMMARYLINES = NEW and tried SUBTOTAL, RECOMPUTE and SUMMARIZE, but it always gives the latest value.

Can somebody suggest a way to do a subtotal on alphanumeric fields?


Thanks

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


WebFOCUS 7.7.02Windows
Output Formats: Excel, HTML, PDF
September 16, 2011, 04:15 PM
Tom Flynn
COLUMN1/A20 = '12345678901234567890';
COLUMN2/P20 = EDIT(COLUMN1);

OR

COLUMN2/I20S = EDIT(COLUMN1);


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
September 16, 2011, 04:23 PM
sumant
Hello Tom,

I tried what you told but it is not working.
The following is my define.
alpha_amt_sold/A20=FTOA(LL_AMT_SOLD, '(D20.2)', alpha_amt_sold);
equivsold/A20=IF type EQ 'Forward' THEN '' ELSE alpha_amt_sold;

I am converting the LL_AMT_SOLD (originally D20.2) to alpha so that I can use the second define.
Now I have to subtotal on the field "equivsold" which is an A20 now.
When I use the EDIT function, it is giving me a zero.

Thanks


WebFOCUS 7.7.02Windows
Output Formats: Excel, HTML, PDF
September 16, 2011, 04:43 PM
Tom Flynn
You still bring the LL_AMT_SOLD column in:
 
TABLE FILE XXX
SUM
  COMPUTE X_AMT/D20.2 = IF type EQ 'Forward' THEN 0 ELSE LL_AMT_SOLD; NOPRINT
BY MAIN_SORT_COLUMN
PRINT
 equivsold
BY MAIN_SORT_COLUMN
ON MAIN_SORT_COLUMN SUBFOOT
" <+0><ST.X_AMT "
ON TABLE SET STYLE *
TYPE=SUBFOOT, STYLE=BOLD, HEADALIGN=BODY,$
ENDSTYLE
END
-EXIT




Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
September 16, 2011, 05:21 PM
<FreSte>
Can something like this be used:


TABLE FILE CAR
  SUM
    COMPUTE DD/P20 MISSING ON = IF SALES LT 30000 THEN MISSING ELSE SALES;
    BY COUNTRY
    BY CAR
  ON TABLE SET NODATA Forward
  ON TABLE SUBTOTAL
END

September 19, 2011, 12:38 PM
sumant
Thanks a lot Tom and FreSte for the responses. I will try to implement your response and will update the thread.


WebFOCUS 7.7.02Windows
Output Formats: Excel, HTML, PDF
September 19, 2011, 04:27 PM
sumant
Thanks a lot Tom and Freste for your sloutions.
They solved my issue.


WebFOCUS 7.7.02Windows
Output Formats: Excel, HTML, PDF