2013.01.06 03:24 PM
You cannot use dot inside a lambda function to access the month type.
Instead you need to cast to the month type.
months_bw:{[x;y](`month$x) - `month$y }
Von: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] Im Auftrag von jcw
Gesendet: Sonntag, 6. Januar 2013 23:45
An: personal-kdbplus@googlegroups.com
Betreff: [personal kdb+] using temporal .month method in a user defined function
Newbie question:
I'm attempting to use temporal data type methods (java term, sorry) in a function, but I'm getting an error:
q)d:2012.10.01
q)e.2012.11.01
q)d.month
2012.10m
q)e.month
2012.11m
q)months_bw{[x;y]x.month - y.month}
q)months_bw[x;y]
`y.month
Not sure how to resolve this, as the function parameter is clearly a date:
q)type e
-14h
Any thoughts would be greatly appreciated!
Thanks
--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/personal-kdbplus/-/inuqaYXgUSYJ.
To post to this group, send email to personal-kdbplus@googlegroups.com.
To unsubscribe from this group, send email to personal-kdbplus+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.
2013.01.06 03:25 PM
2013.01.16 11:14 AM
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.