COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: salnick4 on 13 Mar 2007 10:28:49 AM

Title: Date Difference calculation with Cube Time Dimension
Post by: salnick4 on 13 Mar 2007 10:28:49 AM
I am having some difficulty in utilizing the days_between function between a level (like Week) within a Time Dimension and a constant date like 2007-01-01.

When I use the following expression I get an error:

_days_between(cast([PFS HBUS Product Analysis Cube].[History Dates].[History Dates].[Week], date), 2007-01-01)

The following is the error I receive:

QE-DEF-0459 CCLException
QE-DEF-0478 Invalid coercion from 'level' to 'value' for '_days_between(cast([PFS HBUS Product Analysis Cube].[History Dates].[History Dates].[Week] as date),2007-01-01)'.

I hope that I have explained myself clearly, if not please let me know.

Thank you very much!
Title: Re: Date Difference calculation with Cube Time Dimension
Post by: MDXpressor on 06 Apr 2007 08:38:22 PM
_days_between is a Relational function, and I'm not sure that you can perform it against a dimensional source.

What is it you are trying to accomplish?  Are you actually trying to count the days between, or are you attempting to compare one period to another?