Forum Discussion
Anonymous
4 years agoNot applicable
Nested IF with Dates
Hi Trying to get quick answer my apologies. Have three dates, ClosedDate, HireDate., OpenDate I need to create a column where if ClosedDate is null then "Open" or if Open date is before today the...
- 4 years ago
Anonymous
No problem, try this instead with the conditions declared more explicitly:
if [ClosedDate] = null then "Open" else if [OpenDate] < Date.Today then "Open" else if [HireDate] > Date.Today then "Open" else "Closed"As before, if you didn't declare the Date.Today variable, you can swap 'Date.Today' in the above for 'Date.From(DateTime.LocalNow())'.
Pete
Anonymous
4 years agoNot applicable
Thanks Pete, I am following, I may need help with logic because it shows when my opendate is after today it shows open but I need it to say closed
BA_Pete
4 years agoSuper User
Anonymous
No problem, try this instead with the conditions declared more explicitly:
if [ClosedDate] = null then "Open"
else if [OpenDate] < Date.Today then "Open"
else if [HireDate] > Date.Today then "Open"
else "Closed"
As before, if you didn't declare the Date.Today variable, you can swap 'Date.Today' in the above for 'Date.From(DateTime.LocalNow())'.
Pete