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     How to retrieve data from the last 24 hours [SOLVED]

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to retrieve data from the last 24 hours [SOLVED]
 Login/Join
 
Member
posted
Hello all,

I'm aware this will likely be a very vague post as I'm very new to WebFocus (currently an apprentice in American Express Technologies).

Basically, I am trying to make a graph display only data from the last 24 hours. Is there some sort of compute that needs to be implemented to get this to work?

Any help would be greatly appreciated, thanks in advance!

Lewis

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 7 | Registered: April 13, 2015Report This Post
Virtuoso
posted Hide Post
Hi Lewis and welcome to Focus world.

You'll effectively need to be more detailed.

Is that really previous 24h from current system time (hh:mm:ss) or is that from previous day?

Which field can be used to filter last 24h data? And what is its format?


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Master
posted Hide Post
If your data sits in SQL/Oracle, our group usually finds it's better to create synonyms off stored procs to pull the data, in which you have to deal with manipulating dates. Just a thought.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Virtuoso
posted Hide Post
Use a DEFINE or COMPUTE (may be more efficient) to determine the current date-time and a second date-time that is 24 hours ago. Function HGETC will provide the current date-time. Function HADD can be used to subtract 24 hours from the current date-time. Then use a WHERE clause to limit the data extract to date-times between these two date-time values.

Since a DEFINE will calculate the two dates for every record retrieved and a COMPUTE will do the same for every record in the internal matrix, a more efficient approach (depending on the size of your data extract) is to calculate the two dates just once, using Dialogue Manager. But this code is complicated for someone new to the tool.

-SET &CURRENT_TIME  = HHMMSS('A8');
-SET &CURRENT_TIMEX = STRREP(&CURRENT_TIME.LENGTH,&CURRENT_TIME,1,'.',1,':',&CURRENT_TIME.LENGTH,'A&CURRENT_TIME.LENGTH');
-SET &CURRENT_DT_TM = DT(&YYMD.EVAL &CURRENT_TIMEX.EVAL);
-SET &24_HOURS_AGO  = EDIT(HCNVRT(HADD(HINPUT(17,'&CURRENT_DT_TM.EVAL',8,'HYYMDI'),'HOURS',-24,8,'HYYMDI'),'(H14)',17,'A17'),'99999999 99:99:99');
-TYPE Current Date-Time=&CURRENT_DT_TM
-TYPE 24 Hours Ago=&24_HOURS_AGO


Using the two dates calculated with Dialogue Manager, the WHERE clause in your GRAPH FILE statement would become:

WHERE <your date-time value> FROM DT(24_HOURS_AGO) TO DT(&CURRENT_DT_TM);


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Master
posted Hide Post
Couldn't you just use the DATEADD method with a -1..

DATEADD(&YYMD ,'BD', -1);



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Virtuoso
posted Hide Post
DATEADD will work if Lewis' dates are SmartDates without a time component. But in that case, I would recommend using function AYMD in Dialogue Manager to calculate the previous day's date so it need be done only once. However, function AYMD will not account for business days or holidays.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Member
posted Hide Post
Hi Lewis
If you need yesterday's data to be extracted I would recomend the following code:

-SET &YESTERDAY_DATE = EDIT (AYMD(&YYMD,-1,'I08YYMD'),'9999/99/99');


and the WHERE clause:
WHERE GE DT(&YESTERDAY_DATE 00:00:00)
AND LE DT(&YESTERDAY_DATE 23:59:59)

Cheers, Ludmila


MRE
EXCEL
 
Posts: 3 | Registered: December 03, 2012Report This Post
Member
posted Hide Post
Thank you all for your responses!

So I think I understand the logic of some of these proposed solutions, but there is something else I need the graph to be able to do.

Is it possible to have a filter 'drop-down' or radio buttons etc. to select today or yesterday for example? If that makes sense.

Thanks!
Lewis


WebFOCUS 8
Windows, All Outputs
 
Posts: 7 | Registered: April 13, 2015Report This Post
Silver Member
posted Hide Post
Hi Lewis,

Yes - you'll need to get someone to show you the HTML composer in developer studio where you will find all sorts of goodies such as drop-down lists and radio buttons.


7.7.05 Windows.
 
Posts: 39 | Location: UK | Registered: July 11, 2012Report 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     How to retrieve data from the last 24 hours [SOLVED]

Copyright © 1996-2020 Information Builders