Discussions

 View Only
Expand all | Collapse all

How to calculate fee based on package size, incurred daily 60 days after [Date Received] to a max of 30 days

  • 1.  How to calculate fee based on package size, incurred daily 60 days after [Date Received] to a max of 30 days

    Posted 09-07-2018 21:41
    Here are the criteria:
    • 3 different [Package Size] 
    • each [Package Size] has a different fee
    • fees are calculate after 60 days after [Date Received]. On the 61st day, the fee begins.
    • fees are charged daily, and up to a max of 30 consecutive days. 
    In for the formula below, on 61 days the fee should be $0.50, then at 90 days it should accrued to $15, instead it calculates a total of only $0.50 when the [Date Received] was in 2017.

    var number DaysOverDue = Min(90, ToDays(Today()-[Date Received]));
    If(([Package Size]="Light" or [Package Size]="Regular") and ($DaysOverDue>60),($DaysOverDue-60),0.5)

    And how do I add another If package size to the formula?


  • 2.  RE: How to calculate fee based on package size, incurred daily 60 days after [Date Received] to a max of 30 days

    Posted 09-07-2018 23:17
    What field type is [Date Received]?


  • 3.  RE: How to calculate fee based on package size, incurred daily 60 days after [Date Received] to a max of 30 days

    Posted 09-08-2018 16:45
    it's a date type


  • 4.  RE: How to calculate fee based on package size, incurred daily 60 days after [Date Received] to a max of 30 days

    Posted 09-08-2018 17:47
    Not sure exactly what you are looking for, but take a look at the formula  below. Let me know if that helps.

    var number DaysOverDue = Min(90, ToDays(Today()-[Date Received])); //# of days late or 90, which ever is smaller

    If(
    ([Package Size]="Light") and ($DaysOverDue>60),(($DaysOverDue-60)*.5), //50 cents every day after 60 days
    ([Package Size]="Regular") and ($DaysOverDue>60),(($DaysOverDue-60)*.75), //75 cents every day after 60 days
    ([Package Size]="Large") and ($DaysOverDue>60),(($DaysOverDue-60)*1), // 1 dollar every day after 60 days
    0)