Help Converting Excel Time( Function to DAX
I have a column of data that has a text string that represents a time of day. Example if 55553 which is 5:55:53 AM.
I need to convert the time to Eastern, and display in a time format. Here is the formula I am currently using in Excel:
=(TEXT([Time of Day],"00\:00\:00")+0)+TIME(1,0,0)
Can you help me convert to a DAX approach please?
Hi Scott,
you need the TIME-function in DAX: TIME(hours, minutes, seconds)
https://msdn.microsoft.com/en-us/library/ee634564.aspx
With some combinations of LEFT & RIGHT Text-Functions, you should be able to pick out the needed numbers from your string. Very much like Excel.
Imke
Similar Messages
-
Need help converting Excel IF statement into CASE WHEN statement for Oracle
Hi,
Hope someone can help I have tried various ways of getting this to work, to no avail!
Bascially I have some figures that are minus figures, and I need to add them together to get a movement figure, but I need to treat the minus figures as minus, if that makes sense, rather than the usual... a minus and a minus makes a plus.
For example:- Budget Figure = -1% and Actual Figure = -68% so the movement needs to be -69%.
The IF statement I have been using in Excel is the following:-
=IF(FO110<0,(FP110-(IF(FO110=0,1,FO110)*-1)),FP110-IF(FO110=0,1,FO110))
Which when using the figures as above = -69%
Cell FO = The Budget Figure
Cell FP = The Actual Figure
However, when I created the CASE statement in Oracle, the figure in the query comes back as -0.67, which is oviously not what I want to happen when both actual and budget are minus figures; however when they are a minus and a plus, it works perfectly fine.
Any help on this would be most appreciated!
Kind regards,
AnnmarieHappy I did'n mess something up :)
Nevertheless, don't show it too much around because
case when budget < 0
then actual - case when budget = 0 /* will never happen */
then 1 /* will never happen */
else budget
end * (-1) /* -budget * (-1) remains only */
else actual - case when budget = 0
then 1
else budget
end
endso at least try the following (if case is more readable as decode for you). Let's hope it works as I don't have a Database at hand
case when budget < 0
then actual + budget
else actual - case when budget = 0
then 1
else budget
end
end Regards
Etbin -
Help converting UIX JSP functionality to UIX
I have an older UIX JSP page that I am trying to convert to UIX. That page contained a table with a singleSelection node and a Print button. When the Print button is pressed, a value is taken from the selected row in the table and sent as a parameter to Oracle Reports. The code that did this in UIX JSP is:
<jbo:OnEvent name="Print">
<% if(sSelected != null)
errmsg = null;
errtype = null;
%>
<jbo:Row id="MPORow1"
datasource="MPOOrders"
action="Find"
rowkey="<%= sKey %>" />
<%
Row MPOCurRow1 = MPOOrders.getRowSet().getCurrentRow();
if (MPOCurRow1 != null)
String ordnum = (String) MPOCurRow1.getAttribute("Ordnum").toString();
String mailer = (String)((Integer) session.getAttribute("loginCustomer")).toString();
String printURL = "https://<myserver>/reports/rwservlet?destype=cache+desformat=PDF+userid=webuser/webpwd@pas+report=mlrjobstatus.rdf+p_mailer=" + mailer + "+p_jobnum=" + ordnum;
response.sendRedirect(response.encodeRedirectURL(printURL));
else
errtype = "error";
errmsg = "You must select a row prior to clicking on the 'Print Lists' button";
%>
</jbo:OnEvent>
How can I do this same thing in UIX/Struts? Can it be done as a UIX handler or do I need a custom DataAction?Hi Eric,
Please take a look at the UIX Table chapter. It talks about single-selection in UIX and how you can add buttons which when clicked will submit events to the server. It also talks about how you can handle those events.
Here is a code snippet from the documentation regarding the event handler:
public static EventResult doSelectionEvent(BajaContext bc, Page page,
PageEvent event)
DataObject tableRows = new PageEventFlattenedDataSet(event, "table1");
int index = SelectionUtils.getSelectedIndex(tableRows);
String name = "Nothing Selected";
// make sure that something was selected:
if (index>=0)
DataObject row = _TABLE_DATA.getItem(index);
name = row.selectValue(null, "name").toString();
EventResult result = new EventResult(page);
result.setProperty("action", event.getName());
result.setProperty("name", name);
return result;
}Thanks,
Jeanne -
FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.
HI EXPERTS,
FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.
PLS DO HELP.....Hiii gita
we have another FM SPELL_AMOUNT
regards
Jaipal -
Hi,
I am trying to create a desktop countdown timer (personal project) however I am getting some issues with the script. The countdown timer works fine until I try and get user inputs. I have created some variables to store the end date and have a series of input fields for the user to provide their desired date.
I have provided the complete actionscript below in the hope this will help idenitfy the issue. Basically when the user inputs their desired date and click OK the application takes these values converts them to a number and assigns them to the date variables. Then it is supposed to update the countdowntimer start counting down from this new date value.
I have used trace to ensure the initial values are correct (which they are) and the ensure the user inputs are getting through and they are, I just can't seem to get the timer to refresh with the updated end date.
CODE
// import flash common system classes
import flash.desktop.*;
import flash.net.*;
import flash.display.*;
import flash.events.*;
import flash.system.Capabilities;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.*;
import flash.display.Sprite;
// Create Variables and data type them to store application end Date
var myYear:Number;
var myMonth:Number;
var myDay:Number;
//Create user variables to store user inputs
var userYear:String;
var userMonth:String;
var userDay:String;
// Give application varibales initial values
myYear = 2009;
myMonth = 6;
myDay = 2;
// As Jan is referenced in AS as 0 -1 from the actual month number;
myMonth = myMonth -1;
//Assign a new Date variable with the target date initially set.
var endDate:Date = new Date(myYear,myMonth,myDay);
trace (endDate);
//create time with a delay of 1 second
var countdownTimer:Timer = new Timer(1000);
countdownTimer.addEventListener(TimerEvent.TIMER, updateTime);
countdownTimer.start();
//Update timer function fired every second
function updateTime(e:TimerEvent):void
var now:Date = new Date();
var timeLeft:Number = endDate.getTime() - now.getTime();
var seconds:Number = Math.floor(timeLeft / 1000);
var minutes:Number = Math.floor(seconds / 60);
var hours:Number = Math.floor(minutes / 60);
var days:Number = Math.floor(hours / 24);
seconds %= 60;
minutes %= 60;
hours %= 24;
var sec:String = seconds.toString();
var min:String = minutes.toString();
var hrs:String = hours.toString();
var d:String = days.toString();
if(sec.length < 2) {
sec = "0" + sec;
if(min.length < 2) {
min = "0" + min;
if(hrs.length < 2) {
hrs = "0" + hrs;
if(d.length == 2) {
d = "0" + d;
if(d.length == 1) {
d = "00" + d;
var time:String = d + ":" + hrs + ":" + min + ":" + sec;
countDown_mc.time_txt.text = time;
//create event listener
background_mc.addEventListener(MouseEvent.MOUSE_DOWN, back_CLICK);
close_btn.addEventListener(MouseEvent.CLICK, closeButton_CLICK);
settings_btn.addEventListener(MouseEvent.CLICK, settingsbtn_CLICK);
settings_mc.ok_btn.addEventListener(MouseEvent.CLICK, okbtn_CLICK);
settings_mc.cancel_btn.addEventListener(MouseEvent.CLICK, cancelbtn_CLICK);
//***** ASSIGN FUNCTIONS ******
//function to action when back MC listener is activated
function back_CLICK(e:MouseEvent):void
stage.nativeWindow.startMove();
//function to action when the close button listener is activated
function closeButton_CLICK(e:MouseEvent):void
NativeApplication.nativeApplication.exit();
//Set function for click event on settings button
function settingsbtn_CLICK(e:MouseEvent):void
//Setup an alpha tween on the timer display
var clockAlphaTween1:Tween = new Tween(countDown_mc, "alpha", Strong.easeOut, 1,0,2,true);
//Listen for when the tween has finished and then run function
clockAlphaTween1.addEventListener(TweenEvent.MOTION_FINISH, clockAlphaTween1_FINISH);
//Function for when alpha tween above is finished
function clockAlphaTween1_FINISH(e:TweenEvent):void
//Setup an alpha tween for the settings mc
var settingsAlphaTween1:Tween = new Tween(settings_mc, "alpha",Strong.easeOut, 0,1,2,true);
//Setup a motion tween on the x axis for settings mc
var settingsXTween1:Tween = new Tween(settings_mc, "x",Strong.easeOut, 416, 96, 2,true);
//Set function for click event for the cancel button
function cancelbtn_CLICK(e:MouseEvent):void
//Setup an alpha tween on the settings mc
var settingsAlphaTween2:Tween = new Tween(settings_mc, "alpha",Strong.easeOut, 1,0,2,true);
//Setup a motion tween on the x axis for setting mc
var settingsXTween2:Tween = new Tween(settings_mc, "x",Strong.easeOut, 96, 416, 2,true);
//Listen for when the tween above has finished then run function
settingsXTween2.addEventListener(TweenEvent.MOTION_FINISH, settingsXTween2_FINISH);
//Function for when motion tween has finished
function settingsXTween2_FINISH(e:TweenEvent):void
//Setup alpha tween for timer display
var clockAlphaTween2:Tween = new Tween(countDown_mc, "alpha", Strong.easeOut, 0,1,2,true);
//Set function for click event on ok button
function okbtn_CLICK(e:MouseEvent):void
//Assign user inputed values to variables
userYear = settings_mc.yearInput_txt.text;
userMonth = settings_mc.monthInput_txt.text;
userDay = settings_mc.dayInput_txt.text;
//Convert string values to number data type and replace app variables with these values
myYear = Number(userYear);
myMonth = Number(userMonth)-1;
myDay = Number(userDay);
//Close the settings mc with alpha and motion tweens
var settingsAlphaTween3:Tween = new Tween(settings_mc, "alpha",Strong.easeOut, 1,0,2,true);
var settingsXTween3:Tween = new Tween(settings_mc, "x",Strong.easeOut, 96, 416, 2,true);
//Listen for when motion tween has finished and run function
settingsXTween3.addEventListener(TweenEvent.MOTION_FINISH, settingsXTween3_FINISH);
//Function for when motion tween has finished
function settingsXTween3_FINISH(e:TweenEvent):void
//Run functions
clearSettings();
applyNewTimer();
//Setup motion tween on x axis for timer display
var clockAlphaTween3:Tween = new Tween(countDown_mc, "alpha", Strong.easeOut, 0,1,2,true);
//Function to clear the setting input fields
function clearSettings()
settings_mc.yearInput_txt.text = "";
settings_mc.monthInput_txt.text = "";
settings_mc.dayInput_txt.text = "";
//Function to assign new endDate with new user values.
function applyNewTimer()
var endDate:Date = new Date(myYear,myMonth,myDay);
trace (endDate);if its a timer issue; I think your missing the repeat count, which is why it stops after its first run, modify to match with the follwing:
var countdownTimer:Timer = new Timer(1000, 999);// infinite amount of repeats??
Timer(delay:Number, repeatCount:int = 0)
Constructs a new Timer object with the specified delay and repeatCount states.
If that doesn't solve your problem, try posting the errors you get, or better yet post your fla online so I have a better idea of whats going on -
Need function module to convert system time to local time
Hi Experts,
Need function module to convert system time to local time.
i.e country specific that to in HH:MM format.
Thanks in advance.Dear Prince,
Kindly check the following link which contains the list of function modules for date and time conversion.
[http://www.sap-img.com/abap/date-month-pop-related-function-modules.htm]
Regards -
Need help converting a PDF to excel
Need help converting a PDF to excel, the icon to convert dissappeared suggestions?
Open the file in Acrobat, use File --> Save As... --> Microsoft Word.
Mylenium -
I can't find a "Timer" function in iMovie, help!
I am making a MacBook Speed test video but I need a timer, is there a timer function in iMovie?
Launch Mail. Click "View" in the Mail menu bar.
Select "Customize Toolbar" from the dropdown.
When the sheet drops down, drag the "Search" box into the Tool bar.
or drag the default set into the tool bar into the tool bar. -
When I click the button Subscribe now, it return: "Sorry, this Adobe product is currently not available for sale in your country."
That means I cannot Convert to DOC function??Adobe Reader is free; there is no trial.
Regarding the ExportPDF service; see https://forums.adobe.com/docs/DOC-2596
If ExportPDF is not available in your country, you will need to use Acrobat to convert; there is a 30-day trial available for Acrobat.
If you do have the Acrobat trial install, make sure you open the PDF to convert in Acrobat, not Adobe Reader. -
Report generation Toolkit: Excel report functions error -2146827284
Hi,
I'm trying to create an automated report using excel functions from the report generation toolkit in labVIEW. When I run the program that generates the report first time round (the report consists of several worksheets, each worksheet is added onto the report at a diffferent state in a state machine) it always works fine and no error is generated. However, when I run the program again it will infrequently (sometimes it does, other times it will not) generate the undefined error -2146827284, this is coming from one of the excel report functions and it cannot find it on highlight execution mode.
Does anyone know anything about this error, why it occurs, how to prevent it?
I would appreciate any help.
Thanks,
Rowanmebels_cti wrote:
Found something that helped; https://forums.ni.com/t5/LabVIEW/Error-code-quot-2146827284-quot-when-trying-to-open-an-Excel/m-p/20...
Excel still open
So I added this;
You should use the Application Quit method instead of killing the task. I doubt this is the cause of your issue.
Ben64 -
How to Simulate The Excel LINEST Function in LabVIEW
This may be a dummy question but I’m pressed for time. I have used the Linear Fit.vi function to duplicate the Excel LINEST function and it works great. However, the engineers here want to set the LINEST const option to FALSE. How can I duplicate this option using LabVIEW? I’m using LV v.8.5.1.
Solved!
Go to Solution.Hi Darin,
Your suggestion to use the General Polynomial Fit.vi lead me in the right direction. I am able to duplicate the “const” option within the Excel LINEST function by using this vi. Your response is much appreciated because it saved me considerable time. Attached is a modified version of the Regressions Demo.vi that was available in LV help. It shows how the “const” option makes a difference in the linear slope.
Thanks again,
Dave J.
Attachments:
Regressions Demo for TS1.vi 33 KB -
Does anyone know how to add time using TIME function?
Hi,
I just switched from Excel (lol) and found an error in a key calculation i use. Does anyone know how to automatically add hours to a time? i.e. i have to convert Pacific Time to other U.S. Time Zones so in the past I used this formula in Excel (=B6+TIME(3,0,0)) which is now not working in Numbers. Is there an equivalent?
Thanks for your help!
AlexandraHello
The Terms of Use ruling this forum states:
-+-+-+-+-+-+-+-
+to help you resolve issues, ask questions, get tips and advice, and more.+
+If you have a technical question about an Apple product, be sure to check out Apple's support resources first by consulting the application Help menu on your computer and visiting our Support site to view articles and more on our product support pages.+
+How do I post a question? ‚+
+_If you searched the forums and didn't find an answer to your question or issue_, click the Post New Topic link at the top of a relevant forum page to post your own question.+
-+-+-+-+-+-+-+-
Your question was aked and responded many times.
Searching in existing threads would have give you the response.
When I try to help users in English, I often look in a dictionary but it seems that for many users, reading the Help or the PDF User's Guideis too much work.
In cell D3, the formula is simply:
=TIME(HOUR(B)HOUR(C),MINUTE(B)+MINUTE(C),SECOND(B)SECOND(C))
which match the Numbers's syntax which, what a surprise, is not XL's one
Yvan KOENIG (from FRANCE mercredi 28 mai 2008 17:39:56) -
Converting Excel formulas in Numbers
I am new to Numbers and have an Excel Spreadsheet that I've used previously that calculates the best 4 scores from golfers over a 10 week period. In Excel I used =sum(LARGE[e2:n2,{1,2,3,4}]) but when I use it in Numbers I get a Syntax Error message. Is there anyone who can help me convert the Excel formula so that it works in Numbers.
Numbers does not use excels array functions so this will probably work:
=SUM(LARGE(E2:N2, 1), LARGE(E2:N2, 2), LARGE(E2:N2, 3), LARGE(E2:N2, 4)) -
Conversion from Excel time to labview time
Hello all,
I want to convert the excel time stamp to labview time stamp. Can you all please help me how to do this ?
In my application labview time is 05-11-12 14:56:00 and its equivalent excel time representation is 41218.6222222222.
I tried this formula,
Labview time = 24*3600*(Excel time - 1460) but anwer is wrong.
Thanks.
Kudos are always welcome if you got solution to some extent.
I need my difficulties because they are necessary to enjoy my success.
--RanjeetOk, here's what I found. The conversion is: Time Stamp = 86400*(Excel Time - 1462). But here's the kicker: the timestamp is GMT. You have to add your time zone offset as well. I'm in the Eastern Time Zone, so I had to add 5 hours. I'm not sure what DST will do to this. I'm sure there's ways around it, I just don't have time to look into it more right now.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
Excel Time.png 10 KB -
Programatically convert Excel workbook sheet to an image (bmp or jpeg)
My client has a requirement for me to convert an Excel workbook sheet to an image of any kind, bmp, jpeg, ect. This is a batch Java 1.5 application and I have generated a spreadsheet using JExcelApi. Now I need to email the spreadsheet as an inline image ... the client does not want an attachment. I'm using the Spring framework Mail api to actually email it. This api requires inline content be an image. Therefore, I need a way to programatically convert Excel to an image.
I've done my homework and researched for many hours now, but have not come up with any solutions. I also looked at 3rd party tools googling thru pages and pages of converters, but they all seem to be GUI tools to manually do the conversion. Aspose.cells looked promising but it only supports .Net, for this functionality. Please suggest a 3rd party tool, or provide a code sample of how to do the conversion.
Thanks!hi
if u are using jdk u may try this for saving an Image img to an OutputStream out in jpg format
import com.sun.image.codec.jpeg.*;
JPEGImageEncoder imageEncoder = JPEGCodec.createJPEGEncoder(out);
JPEGEncodeParam encodeParam = JPEGCodec.getDefaultJPEGEncodeParam(img);
encodeParam.setQuality(.75f, true);
imageEncoder.encode(img, encodeParam);
Hope it helps !
Gabi
Maybe you are looking for
-
I export all my bookmarks in HTML. Everything appears fine in html format except of one folder (the one I need, heh!). Any ideas why is that? Thanks
-
Af:InputDate - Calendar datepicker doesn't display Buddhist Era-based year
I use jDeveloper 11g R2 (11.1.2.0.0) and found that calendar datepicker doesn't display the Thai Buddhist calendar year correctly. (It shows gregorian year.) I found Oracle has just released version 11.1.1.6 which support the Thai Buddhist calendar d
-
Hi All, Can you kindly suggest me any Function Module through which I can get to view the Application Log . The Most Important Requirement is it should be for the particular user who is accessing it and not for anyone else. I have tried APPL_LOG_DISP
-
Hi Dear all, Is it Possible to start OC4J from command line.I came to know that it is possible using a batch file but it is missing in my environment.Can anybody help me in this regard. Thanks and Regards. G.Sreekumar
-
RE: Programatically Populating Adobe Forms
Can you programatically insert values into the text boxes and grids of the Adobe forms from an ASP.NET / C# application? My application fills out the information for the user based on selections they make on earlier screens. When they get to the Adob