are you using dimensionnaly datasource or sql datasource ?
in sql you must have a prebuilt function... in dimensionnaly you have function head (<set> , <nb>) where <set> will be the day level and nb is your ?aging? prompt (I do not say this is the proper way to do it, but it should work)