Focal Point
[SOLVED] Guided Ad-Hoc Column Titles

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

June 17, 2010, 11:46 AM
jseaburn
[SOLVED] Guided Ad-Hoc Column Titles
Hi - I am building a guided ad-hoc application that includes multiple measures. I'm trying to figure out how to apply the column titles to the measure(s) that the user picks. The database name(s) of the field(s) are too wordy, so I need something more useful. The only way I've found to do it so far is to create a define for that field and name it something close..but I can't use dollar signs or % signs in the title. Here's a snippet of my code:

SUM
COMPUTE GP%/D12.2 = ( SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_GP_DLRS / SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_PRICE ) * 100;
&Measures.(AND(,BY &PrimarySort.(,).PrimarySort
BY &SecondarySort.(,,).SecondarySort




Any suggestions are appreciated!!

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


WebFOCUS 7.7.03
Linux / Universe Db
HTML/PDF/EXCEL/HTML Active
June 17, 2010, 11:50 AM
jseaburn
Sorry - it looks like some of my code got wiped out in the paste. I'll try to repost.


WebFOCUS 7.7.03
Linux / Universe Db
HTML/PDF/EXCEL/HTML Active
June 17, 2010, 11:56 AM
Francis Mariani
You need to wrap your code with CODE tags: [TIP] Including code in your FocalPoint Post


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
June 17, 2010, 01:05 PM
Dan Satchell
You could use the AS 'title text' feature to set column titles for your reports. You can do so for each report, or create a FEX containing the desired column titles and -INCLUDE that FEX as needed.

SUM 
COMPUTE GP_PCT/D12.2 = ( SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_GP_DLRS /
                         SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_PRICE ) * 100; AS 'GP %'


or

TITLES.FEX:
-SET &GPPCT_TITLE = 'GP %';
-SET &blah1_TITLE = 'blah1';
-SET &blah2_TITLE = 'blah2';
ETC.


REPORT.FEX:
-INCLUDE TITLES [or -MRNOEDIT -INCLUDE TITLES]

TABLE FILE filename
SUM 
COMPUTE GP_PCT/D12.2 = ( SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_GP_DLRS /
                         SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_PRICE ) * 100; AS '&GPPCT_TITLE'



WebFOCUS 7.7.05
June 17, 2010, 02:53 PM
jseaburn
Thank you for the tip! Here's the code I'm working with:
 SUM 
     COMPUTE GP%/D12.2 = ( SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_GP_DLRS / SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_PRICE ) * 100; AS 'GP%'
     &Measures.(AND(<QTY,SALES_COMPLETE_US.SALES_COMPLETE_US.QTY>,<Sales $,SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_PRICE>,<Cost $,SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_COST>,<GP$,SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_GP_DLRS>,<GP%,SALES_COMPLETE_US.SALES_COMPLETE_US.GP>)).Select Measures.
 


I'm able to get a column title for the COMPUTE field, but I'm trying ti get titles for the options available in my list. Even though I have the 'value' set at "Sales $" for EXTENDED_FET_PRICE, when I run the procedure through the guided ad-hoc launch page, it gives me EXTENDED_FET_PRICE as the column heading.


WebFOCUS 7.7.03
Linux / Universe Db
HTML/PDF/EXCEL/HTML Active
June 17, 2010, 03:27 PM
Dan Satchell
When generating the execution code, the parser puts single quotes around column names from your prompt, which causes syntax errors if you try to include AS 'title text' phrases in standard syntax. However, you can "trick" the parser through opportune placement of single quotes in your prompt, like this:

&Measures.(AND(<QTY,SALES_COMPLETE_US.SALES_COMPLETE_US.QTY' AS 'Qty>,
               <Sales $,SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_PRICE' AS 'Sales $>,
               <Cost $,SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_COST' AS 'Cost $>,
               <GP$,SALES_COMPLETE_US.SALES_COMPLETE_US.EXTENDED_FET_GP_DLRS' AS 'GP $>,
               <GP%,SALES_COMPLETE_US.SALES_COMPLETE_US.GP' AS 'GP %>)).Select Measures.

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
June 17, 2010, 03:43 PM
jseaburn
Thank you! That was the right tip, except that I had to put it in my HTML code in the composer/parameters tab instead of in my procedure code.

Nonetheless..it worked! Much appreciated Smiler


WebFOCUS 7.7.03
Linux / Universe Db
HTML/PDF/EXCEL/HTML Active