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.
I am creating a WebFOCUS report using InfoAssist ,My report having one compute field , 1 sort field and 1 across fieLd this report works until i did not apply sort on compute field .
TABLE FILE ibisamp/car
SUM COMPUTE NEWSALE/D12.2=CAR.BODY.SALES /2;
BY CAR.ORIGIN.COUNTRY
ACROSS CAR.BODY.BODYTYPE
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END
When I applied sort on compute field , it gave me an error .(CAR.NEWSALE IS COMPUTE FIELD)
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: CAR.NEWSALE BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT
TABLE FILE ibisamp/car
SUM COMPUTE NEWSALE/D12.2=CAR.BODY.SALES /2;
BY TOTAL NEWSALE NOPRINT
BY CAR.ORIGIN.COUNTRY
ACROSS CAR.BODY.BODYTYPE
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END
Please Suggest ,is this a limitation that we can not use compute field sort(BY TOTAL) and across sort together or I am doing in a wrong way .
while using hold file it works me but i don't want to to use hold file .This message has been edited. Last edited by: FP Mod Chuck,
TABLE FILE CAR
SUM COMPUTE NEWSALE/D12.2=CAR.BODY.SALES /2;
BY CAR.ORIGIN.COUNTRY
BY CAR.BODY.BODYTYPE
ON TABLE HOLD AS TMP
END
TABLE FILE TMP
SUM NEWSALE
BY NEWSALE NOPRINT
BY COUNTRY
ACROSS BODYTYPE
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
This can be a better way to have the result sorted by the total per country
DEFINE FILE CAR
NEWSALE/D12.2=SALES /2;
END
TABLE FILE CAR
SUM NEWSALES
BY TOTAL NEWSALE AS 'Total'
BY COUNTRY
ACROSS BODYTYPE
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END
Trying to answer your question : it's all about internal matrix and the moment the field are available to be used.
To simplify there is 2 steps in a TABLE...END process. Note that I'm not including the whole list, just sample.
In step 1 are processed : BY, ACROSS, WHERE, SUM/PRINT, DEFINE In step 2 are processed : BY TOTAL, WHERE TOTAL, SUM/PRINT COMPUTE
To be able to use BY TOTAL NEWSALE (which is a step 2 command), NEWSALE must "exist before" the use of BY TOTAL. Meaning that the field must exist in the internal matrix before the use of BY TOTAL. So NEWSALE must exist in internal step 1.
When using SUM COMPUTE NEWSALE..., you're defining NEWSALE in internal step 2.
So to be ale to use BY TOTAL NEWSALE you must define NEWSALE in step 1.
Remember that the above is not a full technical explanation, just an overview, you can find more info in Knowledge Base or from IBI courses.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
As per Martin's explanation, if your COMPUTE is a linear function of one variable (as in your example), you can use:
TABLE FILE CAR
SUM COMPUTE NEWSALE/D12.2=SALES /2;
BY TOTAL SALES NOPRINT
BY COUNTRY
ACROSS BODYTYPE
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006