As far as there are only and always 3 different dates it should work. If not there might be some additionally measures necessary like checking the number of dates with rangecount() and branching then per if-then-else into different branches.
This means it will depend on the real data ... whereby I assume that even by multiple nested if-loops the performance is better as with the crosstable + aggregation load.
Thanks to everyone ! I'll try ur suggestions tomorrow; but u'd have to know that I'd need a generic script that works whatever date I add; because right now, i have 4 not 3 dates and 2 more dates could be added..
thus, I don't think the avg() would work in this case