Change the time period after selection of date prompt

66 views Asked by At

I have a promt page in Cognos where you can select "start_date" and "end_date". Now I would like to use the following:

If the first day of a year is selected as "start_date" for example 01.01.2018/2019/2020 then it should use 01.12.2017/2018/2019 as start date.

Does anyone know how to solve this?

I have tried with serveral functions as Case but it doesnt work out :/

Thanks in Advance

1

There are 1 answers

1
Daniel Wagemann On BEST ANSWER

The following filter expression should help out:

[Date] =
if (extract(month, ?startDate?)=1)

then (_add_months(?startDate?,-1)) else (?startDate?)