I've just started to examine the tables within XER files. Within the Calendar table, there is a field called clndr_data, which has the calendar data for each calendar, i.e. the working time / days within the calendar and exceptions.
The problem is how to take this data and then import to say Excel to understand the data further and take a long alphanumeric string and convert this into something more useful. So far I've not found a delimiter.
Has anyone got any advice?
The clndr_data field contains nested arrays of the Calendar Day's
The Brackets in the Data "()" give the line breaks, so:
(0||CalendarData()((0||DaysOfWeek()((0||1()())(0||2()((0||0(f|16:00|s|08:00)())))(0||3()((0||0(f|16:00|s|08:00)())))(0||4()((0||0(f|16:00|s|08:00)())))(0||5()((0||0(f|16:00|s|08:00)())))(0||6()((0||0(f|16:00|s|08:00)())))(0||7()())))(0||Exceptions()((0||0(d|41519)())(0||1(d|41155)())(0||2(d|40364)())(0||3(d|40910)())(0||4(d|41633)())(0||5(d|41094)())(0||6(d|40427)())(0||7(d|40536)())(0||8(d|41235)())(0||9(d|40179)())(0||10(d|40903)())(0||11(d|40543)())(0||12(d|40791)())(0||13(d|41421)())(0||14(d|40728)())(0||15(d|41275)())(0||16(d|41606)())(0||17(d|40329)())(0||18(d|41459)())(0||19(d|40871)())(0||20(d|40507)())(0||21(d|41057)())(0||22(d|40693)())(0||23(d|41268)())))))(0||CalendarData()
yes xertool kit is a good one to look at calendars you can print them out also
Agree with Tom, I spent several days effort in building nested IF statements to figure out the calendar data. I thought I had it, until I realised the way that P6 treats "Exceptions" is very counter-intuitive.
Get a hold of XER Toolkit, its worth the price just to be able to examine calendars.
Richard,
The answer depends on what “something more useful” you are shooting for.
If you actually want to display a graphical calendar in Excel like the one displayed in P6, then parsing the clndr_data string from the xer is the least of your worries. I’d suggest looking for XER Toolkit, which already does this. (Maybe also Primavera Reader.)
The data are not so much “delimited” as “nested” into structured blocks of data, using parentheses. Although all the attributes needed to define the calendar are included, Excel is not going to decipher them on its own. If you really, really wanted to, I suppose you could write some code to parse each string into the corresponding tables, but there’s not much value in having those tables unless you’re going to do calendar-math scheduling in Excel. Seems unlikely. One thing I have done is build a crude table of calendar exceptions using formulas that search for the index of each particular date in each calendar string. Ultimately not very useful if you have access to P6 or one of the other tools.
Good luck, tom