How can I filter on data to show only data out of office.
Working time: Ma - Fri 08:00 - 22.00 hrs
Not working: outside Working time, incl. full weekend
I'll tried this below for example in a script, but is isn't working:
if(Num(WeekDay(Date))>=0 and Num(WeekDay(Date))<=4 and Num(Time)>=Num('08:00:00') and Num(Time)<=Num('22:00:00'), 1, 0) asworktime, if(Num(WeekDay(Date))>=0 and Num(Time)<=Num('08:00:00') and Num(Time)>=Num('22:00:00'), 1, 0) asnoworking
Num() function is used to format a number, but you use a literal as argument in e.g. num('08:00:00').
If you want to parse your literal as a time, use a date/time interpretation function:
or just maketime(8)
If you change your code using interpretation functions, I think your code should work, assuming that Date and Time fields are read by QV as such, date and time, i.e. both should have a numeric representation. If you are in doubt, num(Date) and num(Time) should return numbers (Date large numbers like 41234 and Time smaller than 1).
If they don't return numbers, use time#(Time,'FORMATCODE') and date#(Date,'FORMATCODE') when reading in your data from the source.