TimeStampDiff formula

I am trying to create a workflow for service requests that will take the difference between the Opened Time field and the current time when the service request is set to closed or cancelled.
I do not see a function for timestampdiff when I try to create a workflow. Am I missing something? Is this possible?
Message was edited by:
DavidG

Have you tried Timestamp () ? The Online Help has details on this.
You can use the Trigger Event "Before modified record saved" to use the "Update Values" option to update appropriate field.

Similar Messages

  • TIMESTAMPDIFF  function in OBIEE Answers

    Hi experts,
    I have a Answers report, where I have included a column and changing the fx formula to find out the time diff ..
    TIMESTAMPDIFF(SQL_TSI_DAY, "Bank Transactions - Payor Aging".AccountingDate, "Bank Transactions - Payor Aging".AccountingDate)
    here I want the second "Bank Transactions - Payor Aging".AccountingDate to be replaces with any date like as below
    TIMESTAMPDIFF(SQL_TSI_DAY, "Bank Transactions - Payor Aging".AccountingDate, '06/02/2010') for June-02-2010.
    But, the above date format is working... can any suggest what format I have give here to work.
    Thanks in Advance
    S

    Hi Madan...
    Thanks for the quick reply...
    I want to continue by next question on top of the TIMESTAMPDIFF function....
    TIMESTAMPDIFF(SQL_TSI_DAY, "Bank Transactions - Payor Aging".AccountingDate, TIMESTAMP '2010-06-02 00:00:00')
    how can I pass this part of the value from the Dashboard Prompt. I knew that the dashboard prompt can only be created on the presentation column. I can't put any date column in my datawarehouse datamodel as there is already one. I looking if there any other way of passing the second date value from the dashboard prompt.
    Thanks in Advance
    S

  • TimeStampDiff

    Hello experts,
    I want to know How to use TimeStampDiff function appropriately.
    My requirement is I have a column in the physical layer say time. It is of datatype varchar(5). It stores the values in HH:MM format.
    I want to have the difference between the current time and this column.
    For current time, Im using function in OBI Answers: CURRENT_TIME(2) where 2 denotes the precision of seconds.
    The formula Im using is TIMESTAMPDIFF(SQL_TSI_MINUTE, CAST("Query Time".Time AS TIMESTAMP), CURRENT_TIME(2)).
    This is throwing the following error:
    ORA-01843: not a valid month at OCI call OCIStmtExecute: select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3, D1.c4 as c4, D1.c5 as c5, max(D1.c6) over () as c6 from (select distinct D1.c2 as c1, D1.c3 as c2, D1.c4 as c3, TO_DATE('1900-01-01 03:54:07' , 'YYYY-MM-DD HH24:MI:SS') as c4, D1.c1 as c5, D1.c1 as c6 from (select max(T45654.TOTAL_TIME_SEC) as c1, TRUNC(T45677.DAY_DT) as c2, ROUND( ( TO_DATE('1900-01-01 03:54:07' , 'YYYY-MM-DD HH24:MI:SS') - CAST( cast(T45654.START_HOUR_MIN as DATE) as DATE) ) * 1440 ) as c3, T45654.START_HOUR_MIN as c4 from S_ETL_DAY T45677, S_NQ_ACCT T45654 where ( T45654.START_DT = T45677.DAY_DT and T45654.SAW_SRC_PATH = '/shared/PI BOOK of Business - P2/AE Home Page/Search/P2 - Trust Request' and TRUNC(T45654.START_DT) = TO_DATE('2009-03-09' , 'YYYY-MM-DD') and TRUNC(T45677.DAY_DT) = TO_DATE('2009-03-09' , 'YYYY-MM-DD') ) group by T45654.START_HOUR_MIN, TRUNC(T45677.DAY_DT) ) D1 ) D1 order by c1 desc, c2, c3, c4. [nQSError: 17011] SQL statement execution failed. (HY000).
    Can anybody help me get the right formula?
    thx,
    parag

    Hi.
    I try the similar:
    TIMESTAMPDIFF(SQL_TSI_MINUTE, CAST('14:22' AS TIMESTAMP), CURRENT_TIME(2))
    and I got an error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1843, message: ORA-01843: not a valid month at OCI call OCIStmtExecute: select distinct D1.c1 as c1, ROUND( ( TO_DATE('1900-01-01 12:05:33' , 'YYYY-MM-DD HH24:MI:SS') - CAST( cast('14:23' as DATE) as DATE) ) * 1440 ) as c2 from (select distinct T21473.PROD_CATEGORY as c1 from PRODUCTS T21473 ) D1 order by c1, c2. [nQSError: 17011] SQL statement execution failed. (HY000)
    So the syntax is:
    TimestampDiff (interval, timestamp-expression1, timestamp-expression2)
    If you harcode it:
    Timestampdiff(SQL_TSI_MINUTE, TIMESTAMP '2009-04-28 12:00:00', current_timestamp)
    The results is difference in minutes.
    So you just need to put 'the right expression' in the second place. Try to concatenate current date with your time value and place it insted of TIMESTAMP '2009-04-28 12:00:00' because this inputs only timestamp format.
    Hope this helps.
    Regards,
    Goran
    http://108obiee.blogspot.com/

  • Problem with TIMESTAMPDIFF

    I have this issue.
    I write this formula for a REPORT in a column and there aren't problems.
    CASE WHEN YEAR( "- Service Request Custom Attributes".DATE_6) =YEAR( "- Service Request Custom Attributes".DATE_7) AND WEEK_OF_YEAR( "- Service Request Custom Attributes".DATE_7)> WEEK_OF_YEAR( "- Service Request Custom Attributes".DATE_6) THEN 'iii' ELSE 'aaa' END
    I also write this formula in a new column and there aren't problems.
    TIMESTAMPDIFF(SQL_TSI_HOUR, "- Service Request Custom Attributes".DATE_6, "- Service Request Custom Attributes".DATE_7)
    Now i write this formula and when i click OK is dispayed a ERROR MESSAGE.
    CASE WHEN YEAR( "- Service Request Custom Attributes".DATE_6) =YEAR( "- Service Request Custom Attributes".DATE_7) AND WEEK_OF_YEAR( "- Service Request Custom Attributes".DATE_7)> WEEK_OF_YEAR( "- Service Request Custom Attributes".DATE_6) THEN TIMESTAMPDIFF(SQL_TSI_HOUR, "- Service Request Custom Attributes".DATE_6, "- Service Request Custom Attributes".DATE_7) ELSE 'aaa' END
    Why ?
    ERROR
    [nQSError: 10058] A general error has occurred. [nQSError: 22027] Union of non-compatible types. (HY000)........................
    Thank you!
    Vale

    Hi Vale,
    Just looking at the first 2 formulae and not the combined you populating different data types with your case statement from the Timestampdiff.
    Your case statement generates a string response where as the Timestampdiff generates an integer. Try replacing in your Else statement '1' or '0' to counter the timestampdiff instead of 'aaa'
    Regards
    Mike

  • OBIEE timestampdiff function syntax error

    Hi all,
    I am getting an error while applying timestampdiff function .help me to sort it out.
    TIMESTAMPDIFF(SQL_TSI_DAY,"- Sanction and Disbursment"."Value Date" , VALUEOF(NQ_SESSION.VAR_CAL_CURR_DATE))
    error details
    Formula syntax is invalid.
    [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 22025] Function TimestampDiff is called with an incompatible type.Please have your System Administrator look at the log for more details on this error. (HY000)
    SQL Issued: SELECT TIMESTAMPDIFF(SQL_TSI_DAY,"- Sanction and Disbursment"."Value Date" , VALUEOF(NQ_SESSION.VAR_CAL_CURR_DATE)) FROM "SIDBI Master"

    Aswin,
    Syntax looks to be fine but before applying it here can you check if both these 2 parameters returns date in same format:
    "- Sanction and Disbursment"."Value Date" = 08/21/2011 (No Timestamp)
    VALUEOF(NQ_SESSION.VAR_CAL_CURR_DATE) = 08/21/2011 (No Timestamp)
    Both shud have same format.
    Also, try this for verification
    TIMESTAMPDIFF(SQL_TSI_DAY,"- Sanction and Disbursment"."Value Date" , CURRENT_DATE)
    Hope this helps

  • Calendar - timestampDiff

    hi,
    i've read a lot of threads about calendar(in dashboard prompt) and timestampdiff.
    i have the following question.
    I want to have the periods of days for 2 periods of time-select by calendar in dashboard
    --->
    i created 4 prompts in dashboard prompts using in formula
    CASE WHEN 1=0 THEN "Calendar"."date" ELSE TIMESTAMP '2200-01-01 00:00:00' end(this column is timedate in oracle 10gr2)
    i changed for each the ..01-02 00:.... , an i set 4 presentations variables (dstart1,dstart2,dend1,dend2)
    Then i want to have 2 columns with the period of the days selected before.
    --->>>
    So,i created 2 columns with the following code :
    timestampdiff(sql_tsi_day,'@{dstart1}','@{dend1}')
    timestampdiff(sql_tsi_day,'@{dstart2}','@{dend2}')
    and i added the quantity in a pivot table to see the specified quantity for these 2 periods.
    The question...
    The function timestamp does not recognize the '@{dsrat1}' as timestamp , how can i achieve it?
    I tried timestamp'@{dstart1}' , with no result.
    I have to change the type for my column in adminstrator as 'timestamp"?
    i have to make a new logical column with timestamp??
    Any ideas?
    tnks,for ur time...

    it works for drop-down list
    but not for calendar.
    any other ideas?
    i have to "cast" in some way my 4 presentaions variables which come from dashboard calendar to "format" which is accepted by the function timestampdiff.
    tnks again 4 ur time.

  • TIMESTAMPDIFF in rpd level

    Hi,
    can i able to user TIMESTAMPDIFF forumula in rpd level as a logical table source formula in logical column
    thanks

    Hi,
    Yes you can.The function is available under CalendarDate/Time Functions in the Expression builder dialog.
    Rgds,
    Dpka

  • TIMESTAMPDIFF question

    Does anyone know why I'm getting different result for the following:
    TIMESTAMPDIFF(SQL_TSI_MONTH, expr1, CURRENT_DATE) where expr1 = 10/15/2008. The result is 12.
    TIMESTAMPDIFF(SQL_TSI_MONTH, expr1, CURRENT_DATE) where expr2 = 10/31/2008. The result is 11.
    CURRENT_DATE is 10/2/2009.
    It seems the system treats 10/31/2008 same as 11/1/2008. I also tried to put CAST(expr1 AS DATE) function. The answer is still the same.
    What do I need to do to get the same answer above?

    Hi all,
    I am also curious to know whether the timestampdiff function gives different values when used in different server
    Eg:Timestampdiff(min,2009-10-10,2009-10-12)
    The above formula when used in different environment using different sever gives different values.
    Can we fix this?
    Thanks

  • Need formula assistance

    I need assistance converting a formula field from Crystal Reports to a logical column in Answers.
    The current formula is:
    (90 - (trunc(sysdate)- greatest(NVL(trunc(logondatetime),to_date('01/01/1980','mm/dd/yyyy')), trunc(createdate), trunc(modifydate))))
    Thanks!

    hi
    use evaluate function for greatest and for difference use timestampdiff function
    for greatest values.. use the following formula
    evaluate('greatest(%1,%2,%3)', date1,date2,date3))
    and if you want to calculate difference between dates (i.e. days), you can use.. timestampdiff(sql_tsi_day, date1, date2).
    this is easy method... i hope

  • IF Statement in Member formula V11 -EPMA

    Hi,
    As any one used IF and ENDIF statement in the member formula on EPMA V11? I am using the same but it fails to deploy and I have no clue whatsoever.
    Does it require an expression OpenInputvaluebox and closedInputvaluebox
    Thanks in advance

    Hi,
    This is the member formula formula I am trying to load:
    IF (@IsMbr("Local"))
    IF (@IsMbr(Hsp_InputValue))
    IF (@IsMbr("No Year"))
    IF (@IsMbr("BegBalance"))
    IF (@IsMbr("Forecast"))
    "RTD" = "Apr"->"Periodic" ->&FcstYear1: "Mar" ->"Periodic"->&FcstYear1;
    ELSEIF (@IsMbr("RF1"))
    "RTD" = ("Jul"->"Periodic" ->&FcstYear1: "Mar" ->"Periodic"->&FcstYear1) + ("Apr"->"Periodic"->&FcstYear2 : "Jun"->"Periodic"->&FcstYear2);
    ELSEIF (@IsMbr("RF2"))
    "RTD" = ("Oct"->"Periodic" ->&FcstYear1: "Mar" ->"Periodic"->&FcstYear1) + ("Apr"->"Periodic"->&FcstYear2 : "Sep"->"Periodic"->&FcstYear2);
    ELSEIF (@IsMbr("RF3"))
    "RTD" = ("Jan"->"Periodic" ->&FcstYear1: "Mar" ->"Periodic"->&FcstYear1) + ("Apr"->"Periodic"->&FcstYear2 : "Dec"->"Periodic"->&FcstYear2);
    ENDIF;
    ENDIF;
    ENDIF;
    ENDIF;
    ENDIF;
    Is there a syntax error here?
    Cheers

  • Formula is not working in report

    Hi Friends,
    This is formula iam using in report.but in output iam getting only value 1.
    Iam not getting other values. I think my OR condition is not working.
    ( ( ( ( ( 'KF1' < 0.1000 ) * 1 OR ( ( 'KF1' >= 0.1000 ) AND ( 'KF1' < 0.1200 ) ) * 2 ) OR ( ( 'KF1' >= 0.1200 ) AND ( 'KF1' < 0.1500 ) ) * 3 ) OR ( ( 'KF1' >= 0.1500 ) AND ( 'KF1' < 0.1800 ) ) * 4 ) OR ( 'KF1' >= 0.1800 ) * 5 )
    Iam chenged open and close brackets....but it is not working.
    How to use if condition or else condition in formula?
    How can i get values in output accourding to range?
    Thanks in advance
    Ramu

    Hi Ramu,
    If condition can be used in Formulae like
    Conditional Calculations (IF-THEN-ELSE)
    You can make conditional calculations using Boolean operators An expression in the form
    IF<Logic Expression> THEN <Expression1> ELSE <Expression2> can also be made using a formula in the form
    <Logic Expression> * <Expression1> + NOT <Logic Expression> * <Expression2>
    Example: IF Actual Costs > Plan Costs THEN Plan Costs + Plan Deviation ELSE Actual Costs
    can be written as the following formula:
    (Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (NOT (Actual Costs > Plan Costs)) * Actual Costs
    or
    (Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (Actual Costs <= Plan Costs) * Actual Costs
    Please explain your case as its complex ...
    Thanks
    CK

  • BW 3.5 - Issue with formula variable with replacement path

    Dear experts,
    I'm facing an issue with formula variable with replacement path.
    Just to clarify, I know replacement paths is raising a lot of questions but I've been using this functionnality extensively in the past, both in 7.0 and 3.5, so I'm not looking for basic information about how to use it.
    I'm trying to setup a simple report that would show total values per plant of Purchase Order < 100 €
    To do so I've setup a calculated key figure as follow:
    VAR1 * ("PO value" < 100 ) * "PO value"
    VAR1 is a formula variable with replacement path on 'purchase order' and value attribute 'constant =1'.
    (The report has to show values summarized by plant but should not show the detail PO by PO, so I'm not looking at a solution based on condition)
    The report as characteristic "plant" in rows and my CKF in columns.
    Now let's take an example. I have 3 POs in Plant 1:
    PO1 -> 150€
    PO2 -> 90€
    PO3 -> 80€
    Because of the variable with replacement path, the result in my query should be:
    plant1 = 170 (even though characteristic "purchase order" is not in my rows, system should evaluate PO one by one and return values only for those two that are below 100).
    But the result coming is 320, which is wrong.
    I've done the same report on many other 3.5 systems and it worked perfectly, and I am not able to get proper support from SAP OSS who keep saying that this functionnality is not ready in 3.5 (although I've provided screenshot of this working on another 3.5 system!!! how frustrating...)
    They have also pointed to problems of Before and After aggregation but that has absolutely no impact. Once again, the scenario is working perfectly on other 3.5 systems with the same query design, so i'm sure it has nothing to do with Query Designer options.
    Would anyone have ever come to an equivalenet problem? I'm wondering whether the DB itself could not play a role in the variable with ref  characteristic 'constant =1' ...
    Any though is welcome!
    thanks

    Hi,
    The text variable is replaced when the exact date is clear for this key figure column according to the restriction.
    To achive this, please make sure that either the variable is directly restricted in the key figure selection, or that the date characteristic is in drilldown.
    Regards,
    Patricia

  • How can we remove the commas from the Formula value in SAP BW BEx query

    Hi All,
    How can we remove the commas from the Formula value in SAP BW BEx query
    We are using the formula replacing with characteristic.The characteristic value needs to be display as number with out commas.
    Regards
    Venkat.

    Do you want to remove the commas when you run the query on Bex Web or in RSRT?
    Regards

  • How to appear a formula field for once at a fom-like report?

    Hi All,
    I have created a formula field and then set the property "Maximum Records per page" to the value 12 for the repeating frame containing this field and all other fields.
    Now I want to make an exception for that formula field
    I want it to be appeared only for one time not 12 times!
    how to do this Plz?

    Hi,
    I assume that your formula column is at a higher level than your repeating frame (in other case it's not clear which value you want to display). Bring the filed representing the formula column behind the repeating frame, then it's diplayed only once.
    Regards
    Rainer

  • SSRS 2008 Column Chart with Calculated Series (moving average) "formula error - there are not enough data points for the period" error

    I have a simple column chart grouping on 1 value on the category axis.  For simplicity's sake, we are plotting $ amounts grouping by Month on the category axis.  I right click on the data series and choose "Add calculated series...".  I choose moving average.  I want to move the average over at least 2 periods.
    When I run the report, I get the error "Formula error - there are not enough data points for the period".  The way the report is, I never have a guaranteed number of categories (there could be one or there could be 5).  When there is 2 or more, the chart renders fine, however, when there is only 1 value, instead of suppressing the moving average line, I get that error and the chart shows nothing.
    I don't think this is entirely acceptable for our end users.  At a minimum, I would think the moving average line would be suppressed instead of hiding the entire chart.  Does anyone know of any workarounds or do I have to enter another ms. connect bug/design consideration.
    Thank you,
    Dan

    I was having the same error while trying to plot a moving average across 7 days. The work around I found was rather simple.
    If you right click your report in the solution explorer and select "View Code" it will give you the underlying XML of the report. Find the entry for the value of your calculated series and enter a formula to dynamically create your periods.
    <ChartFormulaParameter Name="Period">
                      <Value>=IIf(Count(Fields!Calls.Value) >= 7 ,7, (Count(Fields!Calls.Value)))</Value>
    </ChartFormulaParameter>
    What I'm doing here is getting the row count of records returned in the chart. If the returned rows are greater than or equal to 7 (The amount of days I want the average) it will set the points to 7. If not, it will set the number to the amount of returned rows. So far this has worked great. I'm probably going to add more code to handle no records returned although in my case that shouldn't happen but, you never know.
    A side note:
    If you open the calculated series properties in the designer, you will notice the number of periods is set to "0". If you change this it will overwrite your custom formula in the XML.

Maybe you are looking for

  • Constant freezing eventually led to mini port not working

    I run bootcamp, and it happens on windows as well so it must be a hardware problem. Unfortunately my coverage is up and I'm unable to pay for anything right now. Basically, the computer was freezing up for a while, a lot of the time it just freezes u

  • How can I set a report to have an audit trail?

    I am using Business Objects Enterprise and am having a difficult time getting an audit trail set up for reports. If reports are scheduled, then the audit trail exists. But if the reports are manually generated, no audit trail exists. Any suggestions

  • Dynex vs Insignia

    Just was curious about these two brands, as I see a Dynex on sale for $475 (46", 1080P, 60HZ). The same Insignia is $200 more for the same thing (except with 120HZ).  I watch a lot of sports and play Wii, so I've heard about 50/50 that 60HZ and 120 H

  • Customer shipping point details

    Hello All, I am trying to create sap query containing customer shipping point details.The format is like.. comp code, cust no, cust name,house bank, shipping point, name of the agent,route etc. what are the tables I can use. please help Srinivas

  • Error occurescan;t attatch library webutil

    hello and hi me install new form 10g with form 9i when i attach webutil.pll with a form and write a code at bush button for open dialog box DECLARE mDialog VARCHAR2(100); BEGIN WEBUTIL_BROWSER.browsermessage (WEBUTIL_FILE_TRANSFER.GET_WORK_AREA()); m