i found the solution by myself. I haven't looked exactly enough at the documentation. To ignore NaN / Unknown values, you have to use the xff (xfiles factor). With a xff of 0.99, the NaN values will be ignored by the consolidation function.
http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html
RRA:AVERAGE | MIN | MAX | LAST:xff:steps:rows
xff The xfiles factor defines what part of a consolidation interval may be made up from UNKNOWN data while the consolidated value is still regarded as known. It is given as the ratio of allowed UNKNOWN PDPs to the number of PDPs in the interval. Thus, it ranges from 0 to 1 (exclusive).