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.
We need to display the currency symbols with the amounts based on the country selected by the user. It could be Australian dollar, France Francs etc. We have the currecncy codes and symbols saved in a database table. The WF extended currency formats support only pound, yen and euro other than dollar. I was hoping we could have something similar to this
TABLE FILE CAR SUM DEALER_COST/&fmtCurr AS 'Dealer Cost' RETAIL_COST/&fmtCurr AS 'Retail Cost' SALES/&fmtCurr AS 'Sales' BY CAR AS 'Car' END
But without WF format for other currencies, I am not sure this would work. It seems like our only option is to convert the amount using FTOA and concatenate the currency symbol.
Any other ideas? Thanks.This message has been edited. Last edited by: CT,
TABLE FILE DATA
PRINT CURRENCY
COMPUTE SP/A2=' ';
COMPUTE NEW_DESC/A40='''' || FORMAAT || '''';
ON TABLE SAVE AS TODECODE FORMAT ALPHA
END
DEFINE FILE xxx
FMAT/A8=DECODE CURRENCY(TODECODE ELSE 'D15.2S');
END
TABLE FILE WHATEVER
PRINT
CURRENCY SALES/FMAT
BY COUNTRY
END
I hope this is what you want....
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
Frank, Thanks for your help. Our users run the reports from a front end application developed internally, where they select the criteria, sum and sort options, date range, currency etc. We save them as global variables like &¤cySymbol which I am trying to append at the beginning or end of the amount fields. I tried your sample code and I am not clear about the syntax for the DECODE
TABLE FILE TEST PRINT HOSTAMOUNT COMPUTE SP/A2=' '; COMPUTE NEW_DESC/A40='''' || '&¤cySymbol.EVAL' || ''''; ON TABLE SAVE AS TODECODE FORMAT ALPHA END
DEFINE FILE TEST FMAT/A8=DECODE HOSTAMOUNT(TODECODE ELSE 'D15.2S'); END
TABLE FILE TEST PRINT HOSTAMOUNT/FMAT WHERE RECORDLIMIT EQ 5 END
I am getting the error for the DECODE line (FOC553) A COMPUTATIONAL EXPRESSION IS TOO LARGE BYPASSING TO END OF COMMAND
I would suggest that you create small datatable that holds the available currency codes and the wanted formats. Two fields CURRENCY and FORMAAT So instead of doing all the set commands you run the that to get the format you want.
TABLE FILE CURRENCIES
PRINT CURRENCY
COMPUTE SP/A2=' ';
COMPUTE NEW_DESC/A40='''' || FORMAAT || '''';
ON TABLE SAVE AS TODECODE FORMAT ALPHA
END
To know what is wrong with your code remove the line "ON TABLE SAVE AS TODECODE FORMAT ALPHA" See what you get in your report.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
Thanks Frank. Your code works fine, but we may not be able use it that way because, WF provides format for only four currencies. USD - 'D10!D' JPY - 'D10!Y' GBP - 'D10!L' EUR - 'D10!E'
We need to support around 25 other currencies.Since we have the actual currency symbols in a DB table, I end up creating a global function
DEFINE FUNCTION CURRFMT(VALUE/D20.2) A1/A22 = FTOA(VALUE, '(D20.2c)', 'A22'); CURRFMT/A27 = '¤cySymbol.EVAL' || A1; ENDThis message has been edited. Last edited by: CT,