Can you tell us a bit more about your setting (data model, chart objects - dimensions and expressions)? Best would be to post a small sample that demonstrates your issue.
In your details sheet object (straight table?), I assume you are showing the details on invoice level (1 invoice per row), and 1 invoice has 1 ClearingDate and 1 Date. Thus you can use (ClearingDate-Date) and you get an unambiguous answer. But calculating the average should give the identical result then? This I don't understand yet.
In your summary sheet object, if you aggregate over several invoices, (ClearingDate-Date) shouldn't return an unambiguous result (unless the difference is the same for all invoices), I believe you would need to use some aggregation here (like an average). It seems you don't, so I am probably way off in my assumptions.
I have attached an example of the out put for both sheet objects. Both are charts, straight tables. Thanks for assisting.
Message was edited by: Sean Smith
Example.xls 19.0 K
For every document you have a Clearing date and an Invoice date, so that works fine.
When you drop your Document you have multiple Clearing and invoice dates, so it makes sense to me that you can not use the same expresion.
The easies solution is to calculate the difference for every document in your script.
(ClearingDate-Date) as DaysToPay,
This way you have the days to pay for all your documents which makes it a lot easier to work with.
Hope this helps,