
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If else statement with Let variable
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Yean Could you please try the below expression. I got the desired output.
Let FirstHalfDate = Date(MonthStart(Addmonths('2022-07-01',-6)),'MM');
Let SecondHalfDate = Date(MonthStart(Addmonths('2022-01-01',-6)),'MM');
Let CutoffDate =if(Month(Today())<=06,'$(FirstHalfDate)','$(SecondHalfDate)');
If this resolves your issue, please like and accept it as a solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Yean Could you please try the below expression. I got the desired output.
Let FirstHalfDate = Date(MonthStart(Addmonths('2022-07-01',-6)),'MM');
Let SecondHalfDate = Date(MonthStart(Addmonths('2022-01-01',-6)),'MM');
Let CutoffDate =if(Month(Today())<=06,'$(FirstHalfDate)','$(SecondHalfDate)');
If this resolves your issue, please like and accept it as a solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much !!!!
I guess I've confused with SQL if else statement ><
