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.
A report we're working on should display a graph with on the X-axis the day of the week (Mon, Tue, Wed, etc), starting today with values that go up to a week back in the past.
Sounds simple, but we're stuck! The items on the X-axis are based on date and should be ordered chronologically, not by day of the week number or alphabetically. Which is what we tend to get as a result...
For example, today (Wednesday) the X-axis should read: "Thu Fri Sat Sun Mon Tue Wed".
It's okay to add relevant extra information on the X-axis, such as the week number, but actual dates are considered too detailed.
I managed the below (the week number on the X-axis is extra), but it breaks around new year:
DEFINE FILE CALENDAR
DoW/wt=DATECVT(DATE, 'I8YYMD', 'YYMD');
END
GRAPH FILE CALENDAR
SUM DOWNR
BY WEEKNR
BY DoW
WHERE DATE FROM 20120202 TO 20120208;
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
END
This message has been edited. Last edited by: Kerry,
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 :
Consider building a list of desired Weekdays in your desired order (Example: -SET &DaysOfWeek = 'xxx'; , which results in something like this: 'Sat' AND 'Sun' AND 'Mon' AND 'Tue' AND 'Wed' AND 'Thu' AND 'Fri') and using that in
ACROSS DoW AS '' COLUMNS &DaysOfWeek.EVAL
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, 2005
Ah, that does it. Thanks! Added benefit: Any days in the week for which there was no record now shows up in the graph too.
I ended up with this code, which is probably a little suboptimal:
-SET &DOW = DOWK(&YYMD, 'A3');
-SET &WEEKDAYSMON = 'Mon AND Tue AND Wed AND Thu AND Fri AND Sat AND Sun';
-SET &WEEKDAYSTUE = 'Tue AND Wed AND Thu AND Fri AND Sat AND Sun AND Mon';
-SET &WEEKDAYSWED = 'Wed AND Thu AND Fri AND Sat AND Sun AND Mon AND Tue';
-SET &WEEKDAYSTHU = 'Thu AND Fri AND Sat AND Sun AND Mon AND Tue AND Wed';
-SET &WEEKDAYSFRI = 'Fri AND Sat AND Sun AND Mon AND Tue AND Wed AND Thu';
-SET &WEEKDAYSSAT = 'Sat AND Sun AND Mon AND Tue AND Wed AND Thu AND Fri';
-SET &WEEKDAYSSUN = 'Sun AND Mon AND Tue AND Wed AND Thu AND Fri AND Sat';
-SET &WEEKDAYS = &WEEKDAYS.&DOW;
DEFINE FILE CALENDAR
DoW/wt=DATECVT(DATE, 'I8YYMD', 'YYMD');
END
GRAPH FILE CALENDAR
SUM DOWNR
ACROSS DoW COLUMNS &WEEKDAYS.EVAL
WHERE DATE FROM 20120202 TO 20120208;
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
END
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 :
Hmm, probably not ... I actually like what you did. Simple is better I guess.
One could get a bit more elaborate and do something like this:
-SET &DOW = LCWORD(3, DOWK(&YYMD, 'A3'), 'A3');
-SET &WEEKDAYSLIST = 'Mon AND Tue AND Wed AND Thu AND Fri AND Sat AND Sun AND Mon AND Tue AND Wed AND Thu AND Fri AND Sat';
-SET &DAYPOS = POSIT(&WEEKDAYSLIST, &WEEKDAYSLIST.LENGTH, &DOW, 3, 'I3');
-SET &WEEKDAYS = SUBSTR(&WEEKDAYSLIST.LENGTH, &WEEKDAYSLIST, &DAYPOS, &DAYPOS + 50, 51, 'A51');
Less lines, yes. Optimal/efficient? debatable.
You probably don't need that .EVAL after &WEEKDAYS in the ACROSS line.
Good question! That command was inserted by the Advanced Graph editor, but it's not listed in our Help files it seems...
I assume it escapes characters that are special to HTML (and probably XML too). I doubt it would do much in PNG or JPEG output, but it could be important to SVG output as under the hood that is an XML format.
I did some quick tests, but it didn't seem to make any difference whether I set HTMLENCODE to ON or OFF...
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 :
Nice solution, but that breaks on weeks that cross a month:
-SET &WEEKDAY1 = DOWK(20120229, 'A3');
-TYPE Last day of February: &WEEKDAY1
-SET &WEEKDAY2 = DOWK(20120230, 'A3');
-TYPE Next day (empty): &WEEKDAY2
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 :