Hi all,it is me again.Since there is no builtin function in KDB/Q to retrieve the weekdayfrom a day, i have built my own version.w:{ {xweekday} ([] num:til 7;weekday:
sunmond
tueswedn
thursfri
sat ) x mod 7) }Any more elegant solution available?Regards,Kim
not that i am aware of.
could be done without a table like in
{sat
sunmond
tueswedn
thurs`fri@x mod 7} .z.d+til 10
{sat
sunmon
tuewed
thufri x mod 7}On Feb 22, 8:01?am, kuentang <kuent...> wrote:> Hi all,>> it is me again.>> Since there is no builtin function in KDB/Q to retrieve the weekday> from a day, i have built my own version.>> w:{ ?{x
weekday} ( num:til 7;> weekday:sun
mondtues
wednthurs
fri`sat ) ?x mod 7) }>> Any more elegant solution available?>> Regards,>> Kim</kuent…>
{sat
sunmon
tuewed
thufri x mod 7}On Feb 22, 8:01?am, kuentang <kuent...> wrote:> Hi all,>> it is me again.>> Since there is no builtin function in KDB/Q to retrieve the weekday> from a day, i have built my own version.>> w:{ ?{x
weekday} ( num:til 7;> weekday:sun
mondtues
wednthurs
fri`sat ) ?x mod 7) }>> Any more elegant solution available?>> Regards,>> Kim</kuent…>
That’s what I get for using the web interface to Google Groups…