cancel
Showing results for 
Search instead for 
Did you mean: 

Else IF problems

0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

varunanand
Contributor
0 Kudos

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

Answers (0)