Focal Point
When condition in webfocus 8 subhead and subfoot

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

December 22, 2014, 02:03 AM
Harish
When condition in webfocus 8 subhead and subfoot
I am storing some data in file.There is one column(linenum) in hold file.
I want to show data in subhead when linenum>0.but it is ignoring this condition and displaying data for linenum=0 as well.

Can anyone tell me what is the best way to put when condition in subhead section in webfocus 8.Because this same query is working fine in webfocus 7.6.4


WebFOCUS 8
Windows, Excel, CSV, PDF
December 22, 2014, 02:10 AM
Ram Prasad E
Harish,

Below code works fine in WF 8. You may need to check the format of linenum. Is it alpha or numeric?

Total sales for France is zero. So no subhead for France.
TABLE FILE CAR
SUM
COMPUTE TOTSALES/D20=SALES; NOPRINT
BY COUNTRY
PRINT
CAR
SALES
TOTSALES NOPRINT
BY COUNTRY
ON COUNTRY SUBHEAD
"</1 SUBHEAD FOR <COUNTRY </1" 
WHEN TOTSALES GT 0 ;
ON COUNTRY SUBFOOT
"</1"
END



Thanks,
Ram

This message has been edited. Last edited by: Ram Prasad E,


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
December 22, 2014, 05:54 AM
Harish
Hi Ram,

Linenum field is coming from another fex file we are including this field in this fex file .we are holding this Linenum value in Hold file like --(ON TABLE HOLD AS SA_OPNBL3 FORMAT ALPHA).can you tell how this can be resolved.


WebFOCUS 8
Windows, Excel, CSV, PDF
December 22, 2014, 06:55 AM
Ram Prasad E
Can you share your code using CAR file.


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
December 22, 2014, 07:11 AM
Harish
Code is:


TABLE FILE SA_OPNBL3
PRINT
OPENNING_BALANCE NOPRINT
TRANSACTION_DATE NOPRINT
RUNNING_AMT NOPRINT
COMPUTE RUN_TOTAL/D23.2 = IF EOD_ACCOUNT EQ LAST EOD_ACCOUNT
AND OPERATING_UNIT EQ LAST OPERATING_UNIT
AND GAAP EQ LAST GAAP
AND OU_COUNTERPARTY EQ LAST OU_COUNTERPARTY
AND CURRENCY EQ LAST CURRENCY
THEN RUN_TOTAL + RUNNING_AMT ELSE RUNNING_AMT; NOPRINT
COMPUTE CURRENCY_TOTAL/D23.2 = RUN_TOTAL + OPENNING_BALANCE; NOPRINT
BY PROCESSING_CNTR NOPRINT
BY CONTROL_UNIT NOPRINT
-*BY OPERATING_UNIT NOPRINT
BY OPERATING_UNIT NOPRINT &PGBRK_UNIT.EVAL
BY EOD_ACCOUNT NOPRINT
BY GAAP NOPRINT
BY OU_COUNTERPARTY NOPRINT
-*BY CURRENCY NOPRINT PAGE-BREAK
BY CURRENCY NOPRINT &PGBRK_CURR.EVAL
BY TRANSACTION_DATE NOPRINT
BY P_TRANSACTION_ID NOPRINT
ON P_TRANSACTION_ID
SUBHEAD
" WHEN LINE_NUM NE 0;

-In this LINE_NUM is coming from another file and we are including that file in this fex file.But this same code is working fine in Webfocus 7.6.4 but not working in webfocus 8.


WebFOCUS 8
Windows, Excel, CSV, PDF
December 22, 2014, 07:12 AM
Harish
sorry .the code is


TABLE FILE SA_OPNBL3
PRINT
OPENNING_BALANCE NOPRINT
TRANSACTION_DATE NOPRINT
RUNNING_AMT NOPRINT
COMPUTE RUN_TOTAL/D23.2 = IF EOD_ACCOUNT EQ LAST EOD_ACCOUNT
AND OPERATING_UNIT EQ LAST OPERATING_UNIT
AND GAAP EQ LAST GAAP
AND OU_COUNTERPARTY EQ LAST OU_COUNTERPARTY
AND CURRENCY EQ LAST CURRENCY
THEN RUN_TOTAL + RUNNING_AMT ELSE RUNNING_AMT; NOPRINT
COMPUTE CURRENCY_TOTAL/D23.2 = RUN_TOTAL + OPENNING_BALANCE; NOPRINT
BY PROCESSING_CNTR NOPRINT
BY CONTROL_UNIT NOPRINT
-*BY OPERATING_UNIT NOPRINT
BY OPERATING_UNIT NOPRINT &PGBRK_UNIT.EVAL
BY EOD_ACCOUNT NOPRINT
BY GAAP NOPRINT
BY OU_COUNTERPARTY NOPRINT
-*BY CURRENCY NOPRINT PAGE-BREAK
BY CURRENCY NOPRINT &PGBRK_CURR.EVAL
BY TRANSACTION_DATE NOPRINT
BY P_TRANSACTION_ID NOPRINT
ON P_TRANSACTION_ID
SUBHEAD
" WHEN LINE_NUM NE 0;


WebFOCUS 8
Windows, Excel, CSV, PDF
December 22, 2014, 07:15 AM
Harish
AFTER SUBHEAD AND BEFORE WHEN LINE_NUM NE 0

THIS LINE IS THEIR



WebFOCUS 8
Windows, Excel, CSV, PDF
December 22, 2014, 07:17 AM
Harish
I don't know why that line is not copying here.
I that line we are printing all the values mentioned in print command +Line_Num as well.


WebFOCUS 8
Windows, Excel, CSV, PDF
December 22, 2014, 08:53 AM
Ram Prasad E
Place your fex code within [ code] ... [ /code]

Note: there should not be any space after "["

Thanks,
Ram


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
December 23, 2014, 01:06 AM
Harish
Can u please explain with one example using "[".


WebFOCUS 8
Windows, Excel, CSV, PDF
December 23, 2014, 04:51 AM
Ram Prasad E
Check if the sample code in first post is working as expected.


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
December 23, 2014, 05:43 AM
Harish
Hi ram

Actually thing is that line_num is packed decimal datatype.So that's why it's not working.Can u tell me how i can convert this to alpha numeric datatype and where i need to do code changes for that.?


WebFOCUS 8
Windows, Excel, CSV, PDF
December 23, 2014, 09:52 AM
Rifaz
Search for PTOA in help.


-Rifaz

WebFOCUS 7.7.x and 8.x