Skip to Content
avatar image
Former Member

Else IF problems

Hi'

Here's the formula:

If DateDiffInDays({DATE_BT}, CurrentDate()) <= 30 then "0-30" Else

If DateDiffInDays({DATE_BT}, CurrentDate()) > 30 and DateDiffInDays({DATE_BT}, CurrentDate()) <= 90 then "30-90" Else

if DateDiffInDays({DATE_BT}, CurrentDate()) > 90 and DateDiffInDays({DATE_BT}, CurrentDate()) <= 120 then "90-120" Else

if DateDiffInDays({DATE_BT}, CurrentDate()) > 120 then "+120"

It keeps telling me "No viable alternative at "If, try rewriting the formula".

Should I be moving the DateDiffInDays formula to another calculated field and use that filed instead in this calculation?

Thanks

Using Lumira Desktop Enterprise 1.29.3

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 04, 2016 at 05:08 PM

    Hi Pascal,

    I got a similar error while using multiple if-then-else statements. A work around for it was,

    1) creating a separate dimension for DateDiffInDays({DATE_BT}, CurrentDate()).

    2) then in the Prepare room using the Group by Range option to set the first 3 conditions.

    3) replacing others with "+120" and the interval values with your labels.

    Please let me know if there are any questions or comments.

    Thank you,

    Varun Anand

    Add comment
    10|10000 characters needed characters exceeded