Focal Point
[SOLVED] stumped on using values in dropdown.

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

February 12, 2009, 11:27 AM
Guy
[SOLVED] stumped on using values in dropdown.
I am trying to create a way that date related values are available in a drop down for a user to select. I wanted this to be a situation that as the years change, the most recent values were available without recoding a report.

The following code creates the values and descriptions that I would like to use.

I tried to put them in a -PROMPT but then read and found you could not use an ampervariable in a -PROMPT line (or something to that effect).

Any suggestions would be appreciated.

Guy



-SET &SDATE=&YYMD;
-SET &SDATEY=EDIT(&SDATE,'9999$$$$');
-SET &SDATEM=EDIT(&SDATE,'$$$$99$$');
-SET &YEARCUR=(&SDATEY);
-SET &FALLCUR=&YEARCUR||50;
-SET &FALLCURD='FALL '|&YEARCUR;
-SET &YEAR1D=(&SDATEY-1);
-SET &FALL1D=&YEAR1D||50;
-SET &FALL1DD='FALL '|&YEAR1D;
-SET &YEAR2D=(&SDATEY-2);
-SET &FALL2D=&YEAR2D||50;
-SET &FALL2DD='FALL '|&YEAR2D;
-SET &YEAR3D=(&SDATEY-3);
-SET &FALL3D=&YEAR3D||50;
-SET &FALL3DD='FALL '|&YEAR3D;
-SET &YEAR4D=(&SDATEY-4);
-SET &FALL4D=&YEAR4D||50;
-SET &FALL4DD='FALL '|&YEAR4D;
-SET &YEAR5D=(&SDATEY-5);
-SET &FALL5D=&YEAR5D||50;
-SET &FALL5DD='FALL '|&YEAR5D;
-RUN
-TYPE &FALLCURD &FALLCUR
-TYPE &FALL1DD &FALL1D
-TYPE &FALL2DD &FALL2D
-TYPE &FALL3DD &FALL3D
-TYPE &FALL4DD &FALL4D
-TYPE &FALL5DD &FALL5D
-RUN
-END

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


WebFOCUS 7.6.4
Windows XP against an Oracle Database mainly SCT Banner Higher Education ODS and EDW
Various output formats


Guy Brenckle
Budget Analyst
University of Northern Colorado
February 12, 2009, 11:52 AM
GinnyJakes
Can you select the distinct dates from the data?

Could you use a calendar control on your launch page?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 12, 2009, 11:59 AM
Guy
Ginny,

The distinct dates are in the data. However, there are millions of rows and it takes a very long time for the dropdowns to return the dates available.

I am not using a launch page.

Guy


WebFOCUS 7.6.4
Windows XP against an Oracle Database mainly SCT Banner Higher Education ODS and EDW
Various output formats


Guy Brenckle
Budget Analyst
University of Northern Colorado
February 12, 2009, 12:33 PM
GinnyJakes
I would recommend a launch page. You can populate the date dropdown box by using a procedure that generates the dates in a sorted order and does an ON TABLE PCHOLD FORMAT XML at the end of it.

In your launch page control for the dropdown box, you reference a procedure instead of a master for the source of the list.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 12, 2009, 12:54 PM
j.gross
Continuing were Ginny left off ...
Use any convenient data source with at least 6 records in your 'source procedure':
Put as much of the date calculation as you can in DEFINE, rather than -SET.
DEFINE FILE CAR
 LIST/I5 WITH CAR = LIST + 1;
 THIS_YEAR/I4=&YYMD/10000;
 YEAR/I4 = THIS_YEAR + 1 - LIST;
 DESCRIPT/A10=EDIT(YEAR,'FALL 9999');
 VALUE   /A6 =EDIT(YEAR,'999950');
END
TABLEF FILE CAR
PRINT DESCRIPT VALUE
IF RECORDLIMIT EQ 6
ON TABLE PCHOLD FORMAT XML
END

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
February 16, 2009, 10:23 AM
Guy
I finally got this concept.

Thank you very much.


WebFOCUS 7.6.4
Windows XP against an Oracle Database mainly SCT Banner Higher Education ODS and EDW
Various output formats


Guy Brenckle
Budget Analyst
University of Northern Colorado