Focal Point
Use Amper Variable as Detail Column [SOLVED]

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

August 10, 2011, 11:39 AM
redapple
Use Amper Variable as Detail Column [SOLVED]
Hello All,

I am trying to figure out how can I use an amper variable as a detail field in a report.

For example, if I have &work_date, how can I use &work_date as a detail_field.

I know that typically amper variable have a tie-in to master file, but due to special circumstances it is not the case in this situation.

Thanks for any help.

-redapple

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


WebFOCUS 7.6.11
Developer Studio on Windows XP. Server Components running on Windows Server 2003.
Excel, HTML, PDF
August 10, 2011, 12:04 PM
PBrightwell
If I understand you correctly, you are want to print the value of a variable in a report. Try using define or compute.

COMPUTE WORK_DATE/A10=EDIT('&WORK_DATE.EVAL','99/99/9999');


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
August 10, 2011, 12:09 PM
ERINP
redapple,
I believe you can reference the &var in the detail using the COMPUTE.
 
COMPUTE work_date/A10 = IF &work_date EQ '' THEN '' ELSE &work_date; AS 'WORK DATE'
 



WebFOCUS 7.6.9

Reporting client Windows 2003 Service pack 2 using IIS and TomCat 5.5
Reporting Server OS/400 V5R4M0
Outputs: HTML, Excel, PDF, CSV, and Flat Files
August 10, 2011, 01:13 PM
redapple
Thanks to PBrightwell and ErinP for the quick and correct help.

As a newbie sometimes we search for the harder solution...


WebFOCUS 7.6.11
Developer Studio on Windows XP. Server Components running on Windows Server 2003.
Excel, HTML, PDF
August 11, 2011, 12:47 PM
j.gross
quote:
COMPUTE work_date/A10 = IF &work_date EQ '' THEN '' ELSE &work_date; AS 'WORK DATE'

Better put quotes around &work_date

Without them you can wind up with (say)
... = IF 01/01/2012 EQ '' ...
which will throw an error (comparison between numeric and alpha values).