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] Getting the last 11 week data from the current week.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Getting the last 11 week data from the current week.
 Login/Join
 
Gold member
posted
Hi!
i have a week no field of size A2.
and i want to caculate the last 11 week from the week no selected.
when i am doing its showing some error.
Can you please suggest some syntax to get the last 11 week data from the current or selected week.

I'm struck with this.
Need help.

Thanks in advance.

Arpita

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


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 43 | Registered: October 04, 2010Report This Post
Virtuoso
posted Hide Post
Maybe posting some code of what you tried might help to better understand what you want.

The first thing that I see is you have a weeknumber field A2...why...calculating with strings is not easy.
Second: we now live in week nr 8 or something like that. 11 weeks before this week is probably week nr 49 of the former year.
So it would be better to not start with the real week number but with a smartdate field
The actual date is 2011/02/21
11 weeks ago it was 2011/02/21 minus 7*11 days
now use the proper formula to go to that date and then calc the week number for that date.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
Hi frank,
Thanks a lot for your reply.
My case is like, i want to generate a report from the intranet. For that we are taking our data from a view.
That View contain a week no and weekend date.

From the front end we have the user input.One is from date and to date.

Now, our requirement is to generate the report from the date selected in FROM DATE BOx to the last 11 weeks data.

Previously we were comparing the From date and To date with our weekend field.


Can you please suggest. what syntax should i use to extract 11 weeks data from the selected date.
We can use either week no or weerkend date.
As our view contain both fields.
But in report it should contain in total 12 weeks data.

Thanks in advance.
I really nmeed some help.

Thanks
Arpita


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 43 | Registered: October 04, 2010Report This Post
Virtuoso
posted Hide Post
Arpita

what is the format of the weekend data
is it like a date (20110220)

if you only have a week number you can calculate the fist of the day of a week by a formula
suppose you have week nr 2 than the date is 2*7 =14 after the base day of the year (suppose 20110101) from that point back you can calculate the remainder weeks (11-2) = 9*7 days =63
so the beginning of your meassure period is 63 days before 20110101 and that brings you to 20101029.
the last day of your messaure periode will be 20110114.

If you start in week 17 your first and last day will both be in the same year.
In the formulas you hae to build in that restrictions.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
Hi Frank,
Thanks a lot for your reply.
The format of weekend date is (YYMD).
Is there any way by which we can calculate the last 11 Week's data with the help of the Weekend date.
Can you Please Suggest.
What syntax should i use to extract 11 weeks data from the selected date.
At present we are using Weekend Date in our selection criteria.

But in report it should contain in total 12 weeks data.

Thanks in advance.
Your advice will be very helpful.

Thanks
Arpita


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 43 | Registered: October 04, 2010Report This Post
Virtuoso
posted Hide Post
Arpita

what is wrong with my former answer

if you do have the weekend date, let us say '20110227' (yesterday) you can calculate 12 weeks earlier by 12*7=84 days subtracting from that start date


-DEFAULT &LASTDATE='20110227';
-SET &FIRTSDATE=DATECVT((DATEADD((DATECVT(&LASTDATE,'I8YYMD','YYMD')),'D', -84)),'YYMD','I8YYMD');


So now you have two dates
the next step is to create your report with data selected btween those 2 dates.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
Hi Frank
Thanks a lot for your reply.
The firstdate and last date syntax worked.

Thanks for all you replies.

Thanks
Arpita


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 43 | Registered: October 04, 2010Report 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] Getting the last 11 week data from the current week.

Copyright © 1996-2020 Information Builders