Else if - Condition is required error, but all conditions are filled

I have this Activity where all variables are of type DateTime, except ActiveMonths, which is a string. I am converting the result to string on the Assign activities.

I’m getting this error, can anyone help me figure this out?

image

Thanks

Maybe you elaborate more on the overall goal which is aimed. The case has potential to get it modeled in a different way. Thanks

@J0Santos

Its an else if that we see…did you miss any condition on top or bottom?

Is this error coming while running? If so exactly on what activity?

Cheers

@J0Santos,

It seems some conditional statement is working as assignment. Check the values of each variable involved in conditions before Else If activity if they have correct values.

Thanks,
Ashok :slight_smile:

My goal is to check how many months something was active per year. In case the year is the same as the StartDate year, I count how many months it has been active since it started, in case it’s the same as EndDate I use EndDate itself (logic is different from the picture), otherwise I count the entire year (12 months). Does that help?

Thanks!

The entire activity is there, there are no more conditions.
The error comes even before I can run. It gives a compilation error, the same as the image and on that Else if activity. That’s why I’m confused as to why the error is showing…

Thanks!

I’m not currently at the office anymore, but I’ll do that tomorrow.

Thanks!

1 Like

not complete, but sounds in general that we can do it more directly e.g with dateTime compares / subtractions / timespans.

Feel free to share with us some sample dates and the expected output

For the first request, depends on your conditions, but you can use Continue or Break Activity.

@J0Santos

Did you try removing and re adding the activity itself?

Cheers

Today when reopening the project, the Else If 2nd condition was empty, even though, as you can see in the image from my original post, there is a condition there. After re-adding the condition, the error disappeared. So, I guess it was a bug of some sort. Issue is fixed.

Thank you all

1 Like