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     Converting Minutes to Hours and Remaining Minutes

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Converting Minutes to Hours and Remaining Minutes
 Login/Join
 
<Patch4Ever>
posted
I have a data field called total minutes (Format I4) and need to get two Integer fields split out as a result. One would be hours (total minutes divided by 60) and the other would be the remaining minutes. For example, if there are 500 total minutes, I need an integer field (Hours) that would have a value of 8 and an integer field (Minutes Remaining) that would have a value of 20.
 
Report This Post
Virtuoso
posted Hide Post
quote:
I have a data field called total minutes (Format I4) and need to get two Integer fields split out as a result. One would be hours (total minutes divided by 60) and the other would be the remaining minutes. For example, if there are 500 total minutes, I need an integer field (Hours) that would have a value of 8 and an integer field (Minutes Remaining) that would have a value of 20.


Mathmatically - assumes integer truncation

hours = total minutes / 60
minutes left = total minutes - ( hours * 60 )

Compute or define the values as integers with the above formulas. Should work.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
Try:
DEFINE FILE FN
R1/I4 = MINUTEFIELD;
HOUR/I2 = R1/60;
MIN/I2 = IMOD(R1,60,MIN);
ALPHA_TIME/A5 = EDIT(HOUR)| ':' | EDIT(MIN);
END


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
<Patch4Ever>
posted
I really need the calculation done in the total or subtotal part of the report. The total minutes are for all rows of data. If I do the division on each record, the minutes are all less than 60 so the value will be zero (which is what I get in my total section because of the zeros on each row).
 
Report This Post
Virtuoso
posted Hide Post
Try using COMPUTE instead of DEFINE and RECOMPUTE for the subtotals.
TABLE FILE FN
PRINT MINUTEFIELD
COMPUTE HOURS/I3=MINUTEFIELD / 60;
COMPUTE MINUTES/I2=MINUTEFIELD - HOURS * 60;
BY SORT1
BY SORT2
ON SORT1 RECOMPUTE
END

Using RECOMPUTE, at total time, instead of simply summing, FOCUS will recalculate HOURS and MINUTES using the total value of MINUTEFIELD.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
Or you might try
ON ... SUMMARIZE


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report 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     Converting Minutes to Hours and Remaining Minutes

Copyright © 1996-2020 Information Builders