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.
Another word or two: There is date conversion function JULDATE that will convert YYMD or YMD format dates to YYYYJUL or YYJUL. Another function, JULIAN, will extract the number of days from January 1 in the variable DATE and return an integer value. The calculation of week number, a variable often used in retailing, takes a couple of steps. First, the Julian value of week 0 must be known; this probably varies by calendar year. Next, find the julian value of the current DATE. Subtract first from the second and divide the result by 7 to get the number of weeks from week 0. If you cross a year boundary, another step or two would be necessary.
Posts: 252 | Location: USA | Registered: April 15, 2003
Jimster06, WEEK number isn't available as a focus function. Whats available is /W, which is the day of the week, 1-7 (or is it 0-6, whatever ); Week number is a very important field in Retail, and we calculate it depending on the way of the week that "OUR" week begins. Different for Different retailers. So, Week Number is a calculation, using 1) the Smart Date for Jan 1 of the current year, 2) figuring out what day of the week that is. 3) adjusting that smart date value either back a partial week or forward, depending on how we retailers count that partial week at the begining of a year. 4) taking today's smart date, figuring out what day of the week it is, adjusting to the beginning of our "week" 5) taking the difference between the two adjusted smart dates and dividing by 7. That's how we do it. It would, however, be great if ARt would write a UserWrittenSubRoutine to calculate week number, with those aguments. How about asking him for all of us out here in retail land.
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
My bad. I should have referred to WEEKFIRST, HPART, and HNAME. But I do concur with Susannah's suggestion for a more robust week number calculation based my experience with an Arkansas-based retailer.
Posts: 252 | Location: USA | Registered: April 15, 2003
This is a piece of code I have recently written to calculate week numbers, since we're undergoing a major project where I currently work to change all the manufacturing systems from a Sunday-Saturday week to a Monday-Sunday week. Doesn't sound like such a big deal, except the first option gives us a week 53 this year (this was the original week numbering for this year) and now they want to change so there's only 52 weeks this year.
That Hpart thing is cool. Tewy, here's a way you can really shorten your code: To get the week number for today... 1.take the difference between today and the first day of the year (using smart dates) 2. divide that difference by 7 (gives you the current week number) 3.using the MOD function get the remainder from that division, and figure out how many days into the following week we are. 4. adjust your base date (the base of your subtraction) to accomodate whatever adjustments your company is requiring. PRINT MYSMARTDATE AND COMPUTE MYBASEDATE/YYMD=20030101; COMPUTE DAYSTHISYR/I5=MYSMARTDATE - MYBASEDATE; COMPUTE WEEKNUMBER/I4= DAYSTHISYR/7; COMPUTE DAYSINTOWK/I4= IMOD(DAYSTHISYR,7,'I4'); i love working with smart dates. they're just serial dates integer5 in form and math is breeze with them.
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003