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]Passing Variable to report using Dialog Manager

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Passing Variable to report using Dialog Manager
 Login/Join
 
Platinum Member
posted
Hello,

I have a report that I'm using Dialog Manager to determine if they want the data for a Day or Month. This will eventually be run from Report Caster. Report Caster will be set to pass in the correct parameters.

When a D (Day) is entered I want to do a BY on the data by a Date by day.
When a M (Month) is entered I want to do a BY on the data by a Dates Month.

I created a Define field that will convert the date to a MDYY and a define field that pulls the Month out of the date. So basically I want to have ONE DEFINE to pull the correct by based on what the &TIMEFRAME is.

My problem is when using the &TIMEFRAME webfocus isn't recognizing it as a field. The error says: "The Fieldname is not recognized: D"


Example of a Define field that I would like to have:

 
IF &TIMEFRAME EQ 'D' THEN HDATE(actualDate, 'MDYY')
ELSE IF &TIMEFRAME EQ 'M' THEN 
            IF      DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 1 THEN 'January'
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 2 THEN 'February'
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 3 THEN 'March'
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 4 THEN 'April'
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 5 THEN 'May'
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 6 THEN 'June'
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 7 THEN 'July'
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 8 THEN 'August'
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 9 THEN 'September' 
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 10 THEN 'October'
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 11 THEN 'November'
            ELSE IF DPART(HDATE(actualDate, 'MDYY'),'MONTH','I2') EQ 12 THEN 'December';
 

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


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report This Post
Expert
posted Hide Post
Hi Kelly, Would you please forward more of the fex, including the initial setting of the DM variables?




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Platinum Member
posted Hide Post
 
-IF &TIMEFRAME EQ 'D' THEN GOTO DAILYDATES	ELSE IF &TIMEFRAME EQ 'W' GOTO WEEKLYDATES ELSE IF &TIMEFRAME EQ 'M' GOTO MONTHLYDATES;


-SET &CUSTOMERNAME


-DAILYDATES
-SET &BEGINDATE = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-10),'YYMD','I8YYMD');
-SET &ENDDATE = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-1),'YYMD','I8YYMD');
-SET &PRIORDATE = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-1),'YYMD','I8YYMD');
-SET &SORTBYDATE = 'daysort'
 -GOTO FINISH

-WEEKLYDATES
-SET &BEGINDATE = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-56),'YYMD','I8YYMD');
-SET &ENDDATE = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-1),'YYMD','I8YYMD');
-SET &PRIORDATE = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-1),'YYMD','I8YYMD');
-SET &SORTBYDATE = 'weeksort'
-GOTO FINISH

-MONTHLYDATES
-SET &BEGINDATE = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'M',-2),'YYMD','I8YYMD');
-SET &ENDDATE = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-1),'YYMD','I8YYMD');
-SET &PRIORDATE = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-1),'YYMD','I8YYMD');
-SET &SORTBYDATE = 'monthsort'
-GOTO FINISH

-FINISH

 


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report This Post
Platinum Member
posted Hide Post
 
TABLE FILE DETSHIP
PRINT 
     DETSHIP.DETSHIP.proNumber
     DETSHIP.DETSHIP.lessthaneq2
     DETSHIP.DETSHIP.lessthaneq1
     DETSHIP.DETSHIP.between1and2
     DETSHIP.DETSHIP.between2and3
     DETSHIP.DETSHIP.between3and4
     DETSHIP.DETSHIP.greaterthan4
BY  DETSHIP.DETSHIP.day
ON TABLE SUBHEAD
""
WHERE ( DETSHIP.DETSHIP.stopType EQ 'P' ) AND ( DETSHIP.DETSHIP.puLoadType EQ 'LIVE' );
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = enblue_theme,
$
     TITLETEXT='Loading Recap',
$
TYPE=REPORT,
     STYLE=NORMAL,
$
TYPE=DATA,
     BACKCOLOR='NONE',
$
TYPE=TITLE,
     JUSTIFY=CENTER,
$
ENDSTYLE
END

 


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report This Post
Master
posted Hide Post
KellyY,

first of all...

The DEFINE looks okay..
..except for the fact that, depending on the value of &TIMEFRAME the output is MMDY or a Char.

Far better solution is
DEFINE FILE 
   dayfield/MDYY = ...formula...;
   weekfield/I2 = ...formula...;
   monthfield/A10 = ...formula...;
END

-SET &SORTFIELD = IF &TIMEFRAME EQ 'D' THEN 'dayfield' ELSE
-                 IF &TIMEFRAME EQ 'W' THEN 'weekfield' ELSE
-                 IF &TIMEFRAME EQ 'M' THEN 'monthfield' ELSE '';

TABLE FILE ....
PRINT ....
      ....
BY    &SORTFIELD
....
END



Good luck,
Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
It's not clear what's in &TIMEFRAME, but if that's a DM variable that holds either 'D' or 'M', then you created a define that tries to read a field named either D or M. Those fields probably don't exist in your table.

I suspect what you want is '&TIMEFRAME' in that DEFINE instead of plain &TIMEFRAME.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Platinum Member
posted Hide Post
Thank you for all your help.

Dave that worked and was much cleaner.

Wep5622, yes that was the issue I was running into. I didn't try your suggestion since the other one was already written and worked.

Thanks again


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report 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]Passing Variable to report using Dialog Manager

Copyright © 1996-2020 Information Builders