Not signed in (Sign In)

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthornvbike
    • CommentTimeNov 20th 2010
     
    I'm attempting to calculate cost of a multi-day vacation package that includes daily activities/tours and individual hotel nights that are selected a la carte by the user. The challenge is, each of individual hotels has a different seasonal price structure. So, HotelA may offer one set rate from Jan1-Feb28, while HotelB offers a set rate from Jan1-Mar31. And all hotels have different weekday/weekend rates.

    If I were to use the formulas in the professional plan, is it possible to program the following:
    If "DATE" is greater than X and less than Y, AND "HOTEL" is Best Western, then price = Z
    Also, can it be programed to return a different price based on whether the date selected is Sun-Thurs vs. Fri/Sat (If the date is between X and Y and it's Sun-Thurs, price = Z and if it's Fri or Sat, price = Z1

    I hope I've explained this in an understandable way. Thank you for taking the time to answer. I realize this may be more sophisticated than what the program was designed for.
    • CommentAuthordbuschho
    • CommentTimeNov 22nd 2010
     
    Hello,

    Unfortunately I think you may be pushing our system past its limit there.

    You can code simple logic into formula calculations, for example:
    if(HOTEL=="BestWestern"){"10.00"}else{"0"}

    However, complex conditionals, Sat-Sun calculations, etc, would require that you create specialized functions in your custom code block and call them, such as 'dateRange' and 'isWeekend': if(HOTEL=="BW"&&isWeekend(DATE)&&dateRange(DATE,5)){"10.00"}if(HOTEL=="HI"&&isWeekend(DATE)&&dateRange(DATE,8)){"5.00"}
    etc etc etc.

    I think in the end it would be unsatisfactory for what you are wanting to do.

    Happy to help further,
    FormAssembly.com Support.