11 Replies Latest reply: Mar 13, 2013 9:58 PM by Donna Aranzanso

# Computing for Days Delayed

Hello,

I would like to compute for the days delayed in my file. The problem is, the date that I have to compute is only located in 1 field.

Thanks,

Donna

********************[UPDATE]****************************

Since we can now compute the days delayed (answer provided by Flipside).. I have a situation which I have to input in an input box,

ex: Days Delayed [input box]: 3, if I input a number, it will only display the days delayed which is equal to 3.

is this possible?

Thanks a bunch!

-Dona

• ###### Re: Computing for Days Delayed

Hi Donna,

If I've understood correctly, I think this is what you can do in an expression ..

=if(left(no#,1)='b',date-aggr(min(total <id> date), id, no#))

.. however wouldn't it be easier to associate the dates in script?

I'm assuming you only have 2 dates (a & b).

flipside

• ###### Re: Computing for Days Delayed

worked like a charm!

thank you flipside!

it gave me an idea

• ###### Re: Computing for Days Delayed

Hi flipside!

I got a question regarding this one!

Since we can now compute the days delayed.. I have a situation which I have to input in an input box,

ex: Days Delayed [input box]: 3, if I input a number, it will only display the days delayed which is equal to 3.

is this possible?

Thanks a bunch!

-Dona

• ###### Re: Computing for Days Delayed

If you have no other expressions, then you could amend the formula as ...

=if(  if(left(no#,1)='b',date-aggr(min(total <id> date), id, no#))  =daysDelayed,daysDelayed+.001)

... I have added 0.001 to the value and set the number presentation to integer to force zeroes to show if you need them to.

If you have to have other expressions, then the only way might be to set the background colour in the expression to highlight the matching values.

flipside

• ###### Re: Computing for Days Delayed

Hi!

Thanks for the reply! is it possible that if I input something on the input box, it will only show the items that the value of days delayed inputted?

ex: if I input days delayed : 2

then it will only show all the days delayed for 2 days

Thanks!

• ###### Re: Computing for Days Delayed

My earlier reply should give you that - does it not work for you?

=if(if(left(no#,1)='b',date-aggr(min(total <id> date), id, no#))=daysDelayed,daysDelayed+.001)

... the original formula (in italics) is used inside another if statement (the bold part) and it just checks if the formula equals the inputted value (I'm using daysDelayed as my variable name). If there is a match then return the formula (I added 0.001 to force zeroes to show) else do nothing - ie. return Null().

If this is the ONLY expression, then the table should reduce to only those valid rows, but if other expressions are in effect then THIS expression may show as a Null value.

flipside

• ###### Re: Computing for Days Delayed

it works. alright, i'll get back to you as soon as I get back on that expression. Thanks!

• ###### Re: Computing for Days Delayed

thanks flipside! it works! now my only problem is to show also the date it was shipped. are there possible ways to show it on the dimension without getting the 'error in calculation'?

thanks!!

• ###### Re: Computing for Days Delayed

b.u.m.p~

• ###### Re: Computing for Days Delayed

up!

• ###### Re: Computing for Days Delayed

up~