Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2106

Re: Help with Restrict data to 2 comparative Year Period only

$
0
0

Hi Shila,

 

Query level you can do but you have to choose custom query option, which may not be acceptable/suitable in all the situations.

Can filter at Report level but impacts the performance of the report.

 

1) capture User input MonYYYY

Userresponse("Select a Period")

ex: Dec2015

 

2) Convert your calendar date to MonYYYY format

FormatDate(calendardate;"MmmYYYY"))

ex: output will be Jan2015.....Dec2015

 

3) Get user current year month based on response month

=Left([userresponse];3)+FormatNumber(([userresponseYear]);"####")

This gives Dec2015

 

4)Get user previous year month based on response month

=Left([userresponse];3)+FormatNumber(([userresponseYear]-1);"####")

This gives Dec2014


5) Create a flag to check the calendar values to current and previous month values

=If([MonYYYY ]=[CurrentYearMonth];1;If([MonYYYY ]=[PreviousyearMonth];2;0))

 

This gives 1 for calendar period Dec2015 and 2 for Dec2014

 

6) Apply filter on your table block using this flag in 1;2)

so that it will filter only values Dec 2015,2014

 

follow similar approach if you want data for additional months like nov 2015, nov 2014


Viewing all articles
Browse latest Browse all 2106

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>