COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: krunal on 28 Jun 2017 05:23:09 AM

Title: Last Year Data
Post by: krunal on 28 Jun 2017 05:23:09 AM
Hi

I have fiscal year as
2014-2015
2015-2016
2016-2017
2017-2018

I have prompt for fiscal year,

now my requirement is if user select 2016-2017 I want to show the full last year data(i.e 2015-2016)
what will be the condition I have to write

Thanks in advance
Krunal
Title: Re: Last Year Data
Post by: BigChris on 28 Jun 2017 05:32:57 AM
Are your Fiscal Years static choices, or are they based on a selection from your data?
Title: Re: Last Year Data
Post by: krunal on 28 Jun 2017 05:53:13 AM
static choices
Title: Re: Last Year Data
Post by: BigChris on 28 Jun 2017 06:11:28 AM
[YourTranscationDate] between _make_timestamp(
(case ?YourPrompt?
  when '2014-2015' then 2013
  when '2015-2016' then 2014
  when '2016-2017' then 2015
  when '2017-2018' then 2016
    else 1999
  END),1,1)
and  _make_timestamp(
(case ?YourPrompt?
  when '2014-2015' then 2013
  when '2015-2016' then 2014
  when '2016-2017' then 2015
  when '2017-2018' then 2016
    else 1999
END),12,31)

or something like that anyway  :D