Calculated field syntax for Weekdays & Weekends

I am trying to use the following syntax for finding week days and weekend days through the following calculated fields:
Weekdays: ifelse(extract(‘WD’, {DATE}) = 1 OR extract(‘WD’, {DATE}) = 7, NULL, {METRIC})
Weekend days: ifelse(extract(‘WD’, {DATE}) = 1 OR extract(‘WD’, {DATE}) = 7, {METRIC}, NULL)

Hi @Galerie - your syntax looks good to me. What error are you getting? Also just try refreshing your analysis page and adding the calculated field again.

If still not working try breaking into pieces, like do the extract(‘WD’, field) as it’s own calculated field and then reference that in your ifelse calcs. Shouldn’t be necessary, but will help troubleshoot the syntax issue perhaps.

May not fit depending on what you are trying to use this info for, but just wanted to raise there is a new function for calculating work days: netWorkDays - Amazon QuickSight

1 Like