Announcements
cancel
Showing results for
Did you mean:
Luminary Alumni

if formula in script

Hi,

I Need some quick help. It´s stupid but I can just not see my error in my formula here:

if(Status = 3,
if(floor(ConfirmedReceiptDate = '01.01.1800',((floor(ReceiptDate2)) - (floor(PlannedReceiptDate)),
((
floor(ReceiptDate2)) - (floor(ConfirmedReceiptDate))))))) as OnTimeDeliveryInDays,

Staring at this for a lot of time now I´m sure it´s quicker to get some help from somebody here 🙂

Best regards

Carolin

1 Solution

Accepted Solutions
Partner - Specialist III

Hi Carolin,

try this:

if(Status = 3,
if(floor(ConfirmedReceiptDate) = '01.01.1800',(floor(ReceiptDate2)) - (floor(PlannedReceiptDate)),
((
floor(ReceiptDate2)) - (floor(ConfirmedReceiptDate))))) as OnTimeDeliveryInDays,

Marcus

6 Replies
Partner - Specialist III

Hi Carolin,

try this:

if(Status = 3,
if(floor(ConfirmedReceiptDate) = '01.01.1800',(floor(ReceiptDate2)) - (floor(PlannedReceiptDate)),
((
floor(ReceiptDate2)) - (floor(ConfirmedReceiptDate))))) as OnTimeDeliveryInDays,

Marcus

Partner - Champion III

Try this

=if(Status = 3,
if(floor(ConfirmedReceiptDate) = '01.01.1800',floor(ReceiptDate2) - floor(PlannedReceiptDate),
floor(ReceiptDate2) - floor(ConfirmedReceiptDate)
)
) as OnTimeDeliveryInDays,

Here is a missing bracket behind the date-field:

floor(ConfirmedReceiptDate = '01.01.1800'

Also there are too many unnecessary brackets around floor and the subtraction - this is only confusing.

- Marcus

Luminary Alumni
Author

Thank you, this was perfect for copy and paste 🙂 I knew it had to do with the brackets but I couldn´t see it anymore...

MVP

Hi,

Try this expression

if(Status = 3
And
floor(ConfirmedReceiptDate) = '01.01.1800',

(
floor(ReceiptDate2) - floor(PlannedReceiptDate)),
(
floor(ReceiptDate2) - floor(ConfirmedReceiptDate))) as OnTimeDeliveryInDays

Or

if(Status = 3,
if(floor(ConfirmedReceiptDate) = '01.01.1800',

(
floor(ReceiptDate2) - floor(PlannedReceiptDate)),
(
floor(ReceiptDate2) - floor(ConfirmedReceiptDate)))) as OnTimeDeliveryInDays

Regards

Anand

Creator III

Try this:

if(Status = 3,

if(floor(ConfirmedReceiptDate) = '01.01.1800',floor(ReceiptDate2) - floor(PlannedReceiptDate),

(floor(ReceiptDate2) - floor(ConfirmedReceiptDate)))) as OnTimeDeliveryInDays

Community Browser