Hello Cognos Experts!
Before running the report, I want to test if we are the first day of the month or not, if yes, then I want to run the report for the previous fiscalPeriod.
Here is what I put in the a Detail filter expression :
if (current_date=_first_of_month (current_date))
then
([GM].[Dim Time Fiscal].[Fiscal Month Id]=?p_Period?-1)
else
([GM].[Dim Time Fiscal].[Fiscal Month Id]=?p_Period?)
I always got this error
RSV-SRV-0042(see attachement)
------------------------------------------------------------------------------------
I don't understand because the condition work well in a dataItem
if (current_date=_first_of_month (current_date))
then('YES') else
('No')
Hello CognosTuner,
I believe, your filter expression should be as such...
[GM].[Dim Time Fiscal].[Fiscal Month Id] =
if (current_date=_first_of_month (current_date))
then
(?p_Period?-1)
else
(?p_Period?)
-Cognos810
Quote from: CognosTuner on 04 May 2015 01:18:33 PM
Hello Cognos Experts!
Before running the report, I want to test if we are the first day of the month or not, if yes, then I want to run the report for the previous fiscalPeriod.
Here is what I put in the a Detail filter expression :
if (current_date=_first_of_month (current_date))
then
([GM].[Dim Time Fiscal].[Fiscal Month Id]=?p_Period?-1)
else
([GM].[Dim Time Fiscal].[Fiscal Month Id]=?p_Period?)
I always got this error
RSV-SRV-0042(see attachement)
------------------------------------------------------------------------------------
I don't understand because the condition work well in a dataItem
if (current_date=_first_of_month (current_date))
then('YES') else
('No')
I would generally avoid case or if/else logic in a detail filter. Try using an expression that evaluates to a Boolean situation.
(
current_date = _first_of_month (current_date)
and
[GM].[Dim Time Fiscal].[Fiscal Month Id] = ?p_Period?-1
)
or
(
current_date <> _first_of_month (current_date)
and
[GM].[Dim Time Fiscal].[Fiscal Month Id]=?p_Period?
)