if(len(trim(close_date))<>0, close_date - open_date) as Difference_days_open_vs_close_date,
if(len(trim(close_date))=0,Date(today()) - open_date) as Difference_days_open_vs_today_date,
PS: make sure your Open_date and Close_date are already evaluated as dates with the correct format, otherwise you will need to use Date#() and Date() functions