pq有没有一个函数象工作表函数Networkdays一样直接获取两日期的工作日天数(不包括周六和周日的天数)
=NETWORKDAYS(D28,D29)象这个工作表函数一样
pq有没有一个函数象工作表函数Networkdays一样直接获取两日期的工作日天数(不包括周六和周日的天数)
=NETWORKDAYS(D28,D29)象这个工作表函数一样
(startdate as date,enddate as date,optional hld)=>
let
a={Number.From(startdate)..Number.From(enddate)},
b=Table.FromValue(a,[DefaultColumnName="n"]),
c=Table.TransformColumns(b,{"n",Date.From}),
d=if not (hld is list) then {hld} else hld,
e=Table.SelectRows(c,each not List.Contains(d,[n])),
f=Table.Group(
e,
"n",
{"r",each List.Count([n])},
1,
(x,y)=>[
fx=(x)=>Byte.From(Date.DayOfWeek(x,Day.Monday)>4),
r=fx(x)-fx(y)
][r]
)
in Table.SelectRows(f,each Date.DayOfWeek([n],Day.Monday)<5){0}[r]