Hello all,
I am hoping I can get some help with epidata and use of year and week. I currently work on a weekly report that numbers the weeks. However, we've come full circle one year, and I don't want the data to combine week 42 from last year with week 42 from this year. I have tried a number of different fixes, but nothing seems to work. I wanted to convert the 'week' field to a text, and just put "6-" in front of the week, but it just doesn't work! I've tried making week and year defined variables, then putting them together, but that doesn't work either. I've changed the week field from a numeric to text, hoping that would help, but it doesn't. For various reasons, creating a separate year variable is not a good idea, so I've nixed that. Any assistance you can provide would be appreciated. Here is the code I have right now, and it doesn't work:
DATEFROM
MUSTENTER
AFTER ENTRY
DEFINE WEEKS ##
DEFINE YEARS ####
LET WEEKS = WEEKNUM(DATEFROM) + 1
LET YEARS = YEAR(DATEFROM)
LET WEEK = string(YEARS)+string(WEEKS)
END
END
Thanks in advance
Cas Tayor
DEWS Co-ordinator
Cell #03008582627
Small change to your code below. Will that work? Jamie
I am hoping I can get some help with epidata and use of year and week.
Before file DEFINE WEEKS ## DEFINE YEARS #### DEFINE WEEK ####.## end DATEFROM MUSTENTER AFTER ENTRY LET WEEKS = WEEKNUM(DATEFROM) + 1 LET YEARS = YEAR(DATEFROM) LET WEEK = float(YEARS)+float(WEEKS)/100 END END
If you want WEEK as a string, try:
let week = string(years)+"-"+copy(string(100+weeks),2,2) (week is a string of length 7) This will yield WEEK like the following "2006-01" "2006-52"
participants (1)
-
epidata-list@lists.umanitoba.ca