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.
I am really stumped at this, i know what i need to do but i cant quite get my head around this.
I have a file with a column that contains the months as 3 letters (Jan, Feb, Mar etc) and no numbers.
I am feeding in variables from a javascript drop down box but am having problems comparing the values.
DEFINE FILE RODNEY DEF_GEN3_TOTALYEAR = DECODE GEN3_TOTALYEAR ('JAN' '01' 'FEB' '02' 'MAR' '03' 'APR' '04' 'MAY' '05' 'JUN' '06' 'JUL' '07' 'AUG' '08' 'SEP' '09' 'OCT' '10' 'NOV' '11' 'DEC' '12'); END TABLE FILE RODNEY SUM CONDUCTED AS 'Tests Conducted' FAILED AS 'Tests Failed' DEF_GEN3_TOTALYEAR NOPRINT COMPUTE PCTFAILED/D12.2% = FAILED/CONDUCTED * 100; AS 'Fail Pct' BY GEN2_LOCATION AS '2' NOPRINT BY GEN3_LOCATION AS '3' BY GEN5_LOCATION AS '5' ACROSS CALENDARYEAR_CAPTION AS '' ACROSS GEN3_TOTALYEAR AS '' WHERE DEF_GEN3_TOTALYEAR GE '11' AND LE '12'; WHERE CALENDARYEAR_CAPTION EQ '&ADATEY';
This is a small snippet of my code
I am basically trying to use a DEFINE FILE to decode the column GEN3_TOTALYEAR into a number (01, 02, 03)
I then want to use DEF_GEN3_TOTALYEAR and select months in between the selected range
I keep getting a "zero lines in the report" returned with "No HTML Output"
I was able to narrow it down to the bolded line above that if i use the default JAN, FEB, MAR then my report runs fine. When i try to change it into numbers, then i am stumped!This message has been edited. Last edited by: Rodney Chan,
2) The WHERE syntax may be incorrect. It should be:
WHERE DEF_GEN3_TOTALYEAR GE '11' AND DEF_GEN3_TOTALYEAR LE '12';
You can also write that as below, which I find a bit more descriptive:
WHERE DEF_GEN3_TOTALYEAR FROM '11' TO '12';
Either notation tends to translate to a BETWEEN x AND y clause in SQL. Mind that these ranges, just like SQL BETWEEN, are inclusive.
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 :
I totally agree with you that it should be something simple which is why i am quite embarassed that i am even asking!
So i tried the code that you posted and i got the following
PAGE 1
GEN3_TOTALYEAR DEF_GEN3_TOTALYEAR JAN 01 FEB 02 MAR 03 APR 04 MAY 05 JUN 06 JUL 07 AUG 08 SEP 09 OCT 10 NOV 11 DEC 12 FlagOperatorTI FalgShowTI FlagFormatTI FlagCustom FlagSequence FlagMQY FlagActual
----------------------------------
While in a some what frustrated attempt at just hacking at the code and seeing if there was anything else that may be affecting the value. In my earlier (first)post i had provided a code snippet (i didnt think that the below line could cause any difference)
While hacking at the code I noticed that if i took out one of the ACROSS then the code seems to work? Not sure if this has anything to do with anything (i dont see how though)
DEFINE FILE RODNEY DEF_LICLASS_MEM/A20=DECODE LICENCECLASS_MEMBER( R1 'R1' R2 'R2' A 'A' O 'O' Z 'Z' C1 'C1' C2 'C2' ); DEF_GEN3_TOTALYEAR/A02 = DECODE GEN3_TOTALYEAR ( JAN '01' FEB '02' MAR '03' APR '04' MAY '05' JUN '06' JUL '07' AUG '08' SEP '09' OCT '10' NOV '11' DEC '12' ); END TABLE FILE RODNEY SUM CONDUCTED AS 'Tests Conducted' FAILED AS 'Tests Failed' DEF_GEN3_TOTALYEAR COMPUTE PCTFAILED/D12.2% = FAILED/CONDUCTED * 100; AS 'Fail Pct' BY GEN2_LOCATION AS '2' NOPRINT BY GEN3_LOCATION AS '3' BY GEN5_LOCATION AS '5' ACROSS CALENDARYEAR_CAPTION AS '' ACROSS GEN3_TOTALYEAR AS '' ACROSS DEF_LICLASS_MEM AS ' ' COLUMNS R1 AND R2 AND A AND O AND Z AND C1 AND C2 WHERE DEF_GEN3_TOTALYEAR GE '11' AND DEF_GEN3_TOTALYEAR LE '12'; -*WHERE GEN3_TOTALYEAR EQ 'DEC'; WHERE CALENDARYEAR_CAPTION EQ '2003'; END -EXIT
So if i took out the above line, the code seems to work (I get output but my report output then looks all wonky)
Just a shot in the dark here, but who knows, it may hit something. You're using C1 and C2. Be aware that these are reserved names and refer to the first and second column of the report. This may be the cause of the problem. What happens if you use some other id, like D1 or C_1?
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
This is very strange to me, but after speaking to a colleague i stooped to doing the following
For the line
WHERE DEF_GEN3_TOTALYEAR GE '11' AND LE '12';
The values for 11 & 12 are actually fed in from a user input and are months, so they will only go from 1-12.
What I did, and for some reason it works is that I took the variable that was fed in and put it in a decode and used that in the WHERE statement
So something like this
-SET &FROM_MTH=DECODE &VAR1('1' 1 '2' 2.....);
For some reason, THIS seemed to work, im not sure why no other way worked but this seemed to work.
I would dig further, but we are in the middle of upgrading so hopefully in the next version we have this odd bug will be resolved, or when i have more time =)
Just wanted to post an update to this in case anyone stumbles across this.