Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] FML Question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] FML Question
 Login/Join
 
Platinum Member
posted
Hello,

Trying to generate report which looks like

CostGrp Cur_Bud Cur_Act Account
A 100 120 4550
A 110 110 4600
A 0 0 4700
B 100 100 4550
B 0 0 4600
B 0 0 4700
C 0 0 4550
C 0 0 4600
C 100 105 4700

My First Data COST set which contains CostGrp, Cur_Bud, Cur_Act and Account but Account values varies by each CostGrp constant like report want all account regardless this account exists in the CostGrp.

DATASET for Cost
CostGrp Cur_Bud Cur_Act Account
A 100 120 4550
A 110 110 4600
B 100 100 4550
C 100 105 4700

Other DataSet is Acct which contains all the Account but no CostGrp.

DataSet for Acct
Account
4550
4600
4700

For Report I want to show CostGrp and summarized Fields from Cost table which is summarized by each account from Acct table regardless the this account exists in the CostGrp or not want to show with value will be zero for that account.

Hope I tried to explain or if you have question let me know.

Here is my code

TABLE FILE ACCT
SUM
CP_ACTUAL AS 'CURRENT&COMMA.EVALACTUALS'
CP_BUDGET AS 'CURRENT&COMMA.EVALBUDGETS'
FOR ACCOUNT 'G21R1.INPT' GET CHILDREN ADD
BY COSTGRP
END

Thanks,
Viral.

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


WF 7.6.2/ OS WIN2003.
DM 7.6.2
 
Posts: 103 | Registered: September 08, 2006Report This Post
Expert
posted Hide Post
-* viral1.fex - Use FML to generate rows

-SET &ECHO='ALL';

SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
-RUN

FILEDEF COST DISK cost.txt
-RUN

-WRITE COST A 100 120 4550
-WRITE COST A 110 110 4600
-WRITE COST B 100 100 4550
-WRITE COST C 100 105 4700

FILEDEF MASTER DISK cost.mas
-RUN

-WRITE MASTER FILENAME=COST, SUFFIX=FIX, $
-WRITE MASTER SEGNAME=COST, $
-WRITE MASTER FIELDNAME=CostGrp, FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=FILL1,   FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=Cur_Bud, FORMAT=I3, ACTUAL=A3, $
-WRITE MASTER FIELDNAME=FILL2,   FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=Cur_Act, FORMAT=I3, ACTUAL=A3, $
-WRITE MASTER FIELDNAME=FILL2,   FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=Account, FORMAT=A4, ACTUAL=A4, $
-RUN

FILEDEF ACCT DISK acct.txt
-RUN

-WRITE ACCT 4550
-WRITE ACCT 4600
-WRITE ACCT 4700

FILEDEF MASTER DISK acct.mas
-RUN

-WRITE MASTER FILENAME=ACCT, SUFFIX=FIX, $
-WRITE MASTER SEGNAME=ACCT, $
-WRITE MASTER FIELDNAME=Account, FORMAT=A4, ACTUAL=A4, $
-RUN

TABLE FILE ACCT
PRINT
COMPUTE COUNTER/D9 = LAST COUNTER + 1 ; NOPRINT
COMPUTE FOR_CAR/A23 = IF COUNTER EQ 1 THEN '''' | Account | '''' ELSE 'OVER ''' | Account | '''' ;
BY Account NOPRINT
ON TABLE HOLD AS HACCT
END
-RUN

TABLE FILE COST
PRINT
Cur_Bud
Cur_Act
BY CostGrp
FOR Account
-INCLUDE HACCT
ON TABLE HOLD AS HCOST
END
-RUN

TABLE FILE HCOST
PRINT
CostGrp
Cur_Bud
Cur_Act
E02 AS 'Account'
END
-RUN


I'm using the ACCT table to generate the FML FOR commands. Unfortunately, in a hold file, the FOR column does not get a column-name, just an alias, E02 in this case.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Hi Francis,

Thanks for your suggestion,
Let me try and see it works out for me.

Thanks,
Viral.


WF 7.6.2/ OS WIN2003.
DM 7.6.2
 
Posts: 103 | Registered: September 08, 2006Report This Post
Silver Member
posted Hide Post
Hi, tried generating a example using CAR file:

 
TABLE FILE CAR
BY COUNTRY 
ON TABLE HOLD AS FILE1
ON TABLE SET ASNAMES ON
END
-RUN
TABLE FILE CAR
BY CAR 
ON TABLE HOLD AS FILE2
ON TABLE SET ASNAMES ON
END
-RUN
TABLE FILE FILE2
PRINT
COMPUTE KEY/A1 = ' ' ;
CAR
ON TABLE HOLD AS FILE2IND FORMAT FOCUS INDEX KEY
END
-RUN
JOIN CLEAR *
JOIN KEY WITH COUNTRY IN FILE1 TO ALL KEY IN FILE2IND AS J1
DEFINE FILE FILE1
KEY/A1 WITH COUNTRY = ' ' ;
END
TABLE FILE CAR
SUM
SALES 
BY CAR
BY COUNTRY
WHERE RECORDLIMIT LE 6
ON TABLE HOLD AS FILE3
ON TABLE SET ASNAMES ON
END
-RUN

MATCH FILE FILE1
PRINT
*
BY CAR NOPRINT 
BY COUNTRY NOPRINT
RUN
FILE FILE3
SUM
SALES 
BY CAR NOPRINT 
BY COUNTRY NOPRINT 
AFTER MATCH HOLD AS FILE4 OLD-OR-NEW
ON TABLE SET ASNAMES ON
END
-RUN

TABLE FILE FILE4
PRINT 
CAR
COUNTRY
SALES
END
-RUN
-EXIT


Webfocus 8002M, 8009
OS: Windows7
 
Posts: 33 | Registered: July 31, 2008Report This Post
Platinum Member
posted Hide Post
Hi Francis,

I have tested and work as a I want. Great.

Thanks for your suggestion. I will try to implement in the my code.

Thanks,

Viral.


WF 7.6.2/ OS WIN2003.
DM 7.6.2
 
Posts: 103 | Registered: September 08, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] FML Question

Copyright © 1996-2020 Information Builders