The MNYY fields (i.e. JUL10) contains monetary value (i.e. $23,000) for that month, and the elements cover an entire fiscal year.
I am trying to create a report which will loop thru the data file and select the correct no. of MMYY fields to display in a report if the report is requested prior to the end of the fiscal year.
I have been trying to code a fex using the CHECK FILE command:
quote:
CHECK FILE AGEGRP_11_A HOLD -RUN
but I'm not getting far. Any ideas?
quote:
CHECK FILE AGEGRP_11_A HOLD -RUN
TABLE FILE HOLD PRINT FIELDNAME BY FIELDNAME NOPRINT WHERE SEGNO EQ 1 ON TABLE SAVE END -RUN
TABLE FILE AGEGRP_11_A SUM -READ SAVE &Fieldname.A66 -* -REPEAT :Loop WHILE &IORETURN EQ 0; -* &Fieldname -READ SAVE &Fieldname.A66
-:Loop END -RUN
Thanks!This message has been edited. Last edited by: Kerry,
We are in the fourth fiscal month so right now you would like your report to:
TABLE FILE AGEGRP_11_A
SUM JUL10 AUG10 SEP10 OCT10
...
END
Is that what you are getting at?
WebFOCUS 8.2.06
October 26, 2010, 05:27 PM
Waz
Assuming the last 12 fields are needed, the financial year, then this may work.
CHECK FILE AGEGRP_11_A HOLD
-RUN
TABLE FILE HOLD
PRINT FIELDNAME
BY FLDNO NOPRINT
WHERE SEGNO EQ 1
WHERE FLDNO GE 3
ON TABLE SAVE AS FY_COLS
END
-RUN
TABLE FILE AGEGRP_11_A
SUM
-INCLUDE FY_COLS
END
-RUN
If the last 12 will not work, then you may be able to try another method, like filtering on the format, USAGE EQ 'D12.2'. You filter on the field names. FIELDNAME LIKE 'JUL%' OR ....